Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file variable.ml
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192openCoreopenPolytypet=[`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->9;;letget_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.Count;;letconv=[`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;;