Skip to content

Commit 9e11935

Browse files
mheibermeta-codesync[bot]
authored andcommitted
migrate from hh_json to yojson
Summary: ## What migrate from Hh_json to yojson. ## Why More standard, better unicode-handling, one library is better than two. I hope to delete Hh_json . Reviewed By: andrewjkennedy Differential Revision: D93339035 fbshipit-source-id: 52c75c75f58f949fe70e9893d37fc88e6ea2680a
1 parent bd36b94 commit 9e11935

3 files changed

Lines changed: 9 additions & 9 deletions

File tree

hphp/hack/src/client/clientCheck.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -875,7 +875,7 @@ let main_internal
875875
Lwt.return (Exit_status.No_error, telemetry)
876876
| ClientEnv.MODE_STATS ->
877877
let%lwt (stats, telemetry) = rpc args @@ ServerCommandTypes.STATS in
878-
print_string @@ Hh_json.json_to_multiline (Stats.to_json stats);
878+
print_string @@ Yojson.Safe.pretty_to_string (Stats.to_json stats);
879879
Lwt.return (Exit_status.No_error, telemetry)
880880
| ClientEnv.MODE_REMOVE_DEAD_FIXMES codes ->
881881
let%lwt conn = connect args in

hphp/hack/src/utils/core/stats.ml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,12 @@ let get_stats () = { stats with gc_stat = Gc.quick_stat () }
3333

3434
let update_max_heap_size x = stats.max_heap_size <- max stats.max_heap_size x
3535

36-
let to_json stats =
37-
Hh_json.JSON_Object
36+
let to_json stats : Yojson.Safe.t =
37+
`Assoc
3838
[
39-
("init_parsing_heap_size", Hh_json.int_ stats.init_parsing_heap_size);
40-
("init_shared_heap_size", Hh_json.int_ stats.init_heap_size);
41-
("max_shared_heap_size", Hh_json.int_ stats.max_heap_size);
42-
("master_heap_words", Hh_json.int_ stats.gc_stat.Gc.heap_words);
43-
("master_top_heap_words", Hh_json.int_ stats.gc_stat.Gc.top_heap_words);
39+
("init_parsing_heap_size", `Int stats.init_parsing_heap_size);
40+
("init_shared_heap_size", `Int stats.init_heap_size);
41+
("max_shared_heap_size", `Int stats.max_heap_size);
42+
("master_heap_words", `Int stats.gc_stat.Gc.heap_words);
43+
("master_top_heap_words", `Int stats.gc_stat.Gc.top_heap_words);
4444
]

hphp/hack/src/utils/core/stats.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,4 @@ val get_stats : unit -> t
2626

2727
val update_max_heap_size : int -> unit
2828

29-
val to_json : t -> Hh_json.json
29+
val to_json : t -> Yojson.Safe.t

0 commit comments

Comments
 (0)