Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file variable.ml
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102(** A module internal to [Core_bench]. Please look at {!Bench}.
Abstract set of variables used for specifying regressions. *)openCoretypet=[`One(* the "variable" that is always 1 *)|`Runs|`Cycles|`Nanos|`Minor_collections|`Major_collections|`Compactions|`Minor_allocated|`Major_allocated|`Promoted][@@derivingsexp]letmax_int=10letto_int=function|`Runs->0|`Nanos->1|`Cycles->2|`Minor_allocated->3|`Major_allocated->4|`Promoted->5|`Minor_collections->6|`Major_collections->7|`Compactions->8|`One->9letget_units=function|`Runs->Display_units.Count|`Cycles->Display_units.Cycles|`Nanos->Display_units.Time|`Compactions->Display_units.Gc|`Minor_collections->Display_units.Gc|`Major_collections->Display_units.Gc|`Promoted->Display_units.Words|`Minor_allocated->Display_units.Words|`Major_allocated->Display_units.Words|`One->Display_units.Countletconv=[(`Nanos,"Time","Time");(`Cycles,"Cycls","Cycles");(`Runs,"Run","Runs per sampled batch");(`Minor_collections,"mGC","Minor Collections");(`Major_collections,"mjGC","Major Collections");(`Compactions,"Comp","Compactions");(`Minor_allocated,"mWd","Minor Words");(`Major_allocated,"mjWd","Major Words");(`Promoted,"Prom","Promoted Words");(`One,"One","Constant predictor for estimating measurement overhead");]letsummarize()=String.concat~sep:"\n\t"(List.mapconv~f:(fun(_,s1,s2)->sprintf"%-5s - %s"s1s2))letto_short_stringvar=letopt=List.find_mapconv~f:(fun(v,s,_)->ifv=varthenSomeselseNone)inOption.value_exnopt~message:"Bug: Unable to find short string for variable."letof_short_stringstr=letopt=List.find_mapconv~f:(fun(v,s,_)->ifstr=sthenSomevelseNone)inOption.value_exnopt~message:(sprintf"Unable to variable for string %s. Expected one of %s."str(String.concat~sep:", "(List.mapconv~f:(fun(_,s,_)->s))))letto_stringvar=letopt=List.find_mapconv~f:(fun(v,_,s)->ifv=varthenSomeselseNone)inOption.value_exnopt~message:"Bug: Unable to find string for variable."letmake_col_nameresppred=matchpredwith|`One->sprintf"%s Overhd"(to_short_stringresp)|`Cycles->(to_short_stringresp)^"/Cycle"|_->(to_short_stringresp)^"/"^(to_short_stringpred)