always report human readable polys in costs-report.json

Reviewed By: mbouaziz, ddino

Differential Revision: D14004939

fbshipit-source-id: a6dd5552d
master
Martin Trojer 6 years ago committed by Facebook Github Bot
parent 41abbe363d
commit 053d16138e

@ -58,6 +58,7 @@ type json_trace = {
type hum_info = {
hum_polynomial : string;
hum_degree : string;
big_o : string;
}
type cost_item = {
@ -65,7 +66,7 @@ type cost_item = {
loc : loc;
procedure_id : string;
polynomial : string;
?hum : hum_info option;
hum : hum_info;
}
type costs_report = cost_item list

@ -344,13 +344,12 @@ module JsonCostsPrinter = MakeJsonListPrinter (struct
match cost_opt with
| Some {post} ->
let hum =
if Config.developer_mode then
Some
{ Jsonbug_t.hum_polynomial=
Format.asprintf "%a" CostDomain.BasicCost.pp post.basic_operation_cost
; hum_degree=
Format.asprintf "%a" CostDomain.BasicCost.pp_degree post.basic_operation_cost }
else None
{ Jsonbug_t.hum_polynomial=
Format.asprintf "%a" CostDomain.BasicCost.pp post.basic_operation_cost
; hum_degree=
Format.asprintf "%a" CostDomain.BasicCost.pp_degree post.basic_operation_cost
; big_o=
Format.asprintf "%a" CostDomain.BasicCost.pp_degree_hum post.basic_operation_cost }
in
let cost_item =
let file = SourceFile.to_rel_path loc.Location.file in

Loading…
Cancel
Save