Skip to content

Commit fb6da3c

Browse files
committed
add stats for number of Expr sub-classes
1 parent eab467e commit fb6da3c

File tree

3 files changed

+174
-21
lines changed

3 files changed

+174
-21
lines changed

src/libexpr/eval.cc

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2955,7 +2955,35 @@ void EvalState::printStatistics()
29552955
{"elements", memstats.nrValuesInEnvs.load()},
29562956
{"bytes", bEnvs},
29572957
};
2958-
topObj["nrExprs"] = Expr::nrExprs.load();
2958+
topObj["nrExprs"] = {
2959+
{"total", Expr::nrCreated.load()},
2960+
{"ExprInt", ExprInt::nrCreated.load()},
2961+
{"ExprFloat", ExprFloat::nrCreated.load()},
2962+
{"ExprString", ExprString::nrCreated.load()},
2963+
{"ExprPath", ExprPath::nrCreated.load()},
2964+
{"ExprVar", ExprVar::nrCreated.load()},
2965+
{"ExprInheritFrom", ExprInheritFrom::nrCreated.load()},
2966+
{"ExprSelect", ExprSelect::nrCreated.load()},
2967+
{"ExprOpHasAttr", ExprOpHasAttr::nrCreated.load()},
2968+
{"ExprAttr", ExprAttrs::nrCreated.load()},
2969+
{"ExprList", ExprList::nrCreated.load()},
2970+
{"ExprLambda", ExprLambda::nrCreated.load()},
2971+
{"ExprCall", ExprCall::nrCreated.load()},
2972+
{"ExprLet", ExprLet::nrCreated.load()},
2973+
{"ExprWith", ExprWith::nrCreated.load()},
2974+
{"ExprIf", ExprIf::nrCreated.load()},
2975+
{"ExprAssert", ExprAssert::nrCreated.load()},
2976+
{"ExprOpNot", ExprOpNot::nrCreated.load()},
2977+
{"ExprConcatStrings", ExprConcatStrings::nrCreated.load()},
2978+
{"ExprPos", ExprPos::nrCreated.load()},
2979+
{"ExprOpEq", ExprOpEq::nrCreated.load()},
2980+
{"ExprOpNEq", ExprOpNEq::nrCreated.load()},
2981+
{"ExprOpAnd", ExprOpAnd::nrCreated.load()},
2982+
{"ExprOpOr", ExprOpOr::nrCreated.load()},
2983+
{"ExprOpImpl", ExprOpImpl::nrCreated.load()},
2984+
{"ExprOpConcatLists", ExprOpConcatLists::nrCreated.load()},
2985+
{"ExprOpUpdate", ExprOpUpdate::nrCreated.load()},
2986+
};
29592987
topObj["list"] = {
29602988
{"elements", memstats.nrListElems.load()},
29612989
{"bytes", bLists},

0 commit comments

Comments
 (0)