MCPcopy Create free account
hub / github.com/apache/impala / CheckMetrics

Method CheckMetrics

be/src/runtime/tmp-file-mgr-test.cc:132–146  ·  view source on GitHub ↗

Check that metric values are consistent with TmpFileMgr state.

Source from the content-addressed store, hash-verified

130
131 /// Check that metric values are consistent with TmpFileMgr state.
132 void CheckMetrics(TmpFileMgr* tmp_file_mgr) {
133 vector<TmpFileMgr::DeviceId> active = tmp_file_mgr->ActiveTmpDevices();
134 IntGauge* active_metric =
135 metrics_->FindMetricForTesting<IntGauge>("tmp-file-mgr.active-scratch-dirs");
136 EXPECT_EQ(active.size(), active_metric->GetValue());
137 SetMetric<string>* active_set_metric =
138 metrics_->FindMetricForTesting<SetMetric<string>>(
139 "tmp-file-mgr.active-scratch-dirs.list");
140 set<string> active_set = active_set_metric->value();
141 EXPECT_EQ(active.size(), active_set.size());
142 for (int i = 0; i < active.size(); ++i) {
143 string tmp_dir_path = tmp_file_mgr->GetTmpDirPath(active[i]);
144 EXPECT_TRUE(active_set.find(tmp_dir_path) != active_set.end());
145 }
146 }
147
148 /// Check that current scratch space bytes and HWM match the expected values.
149 void checkHWMMetrics(int64_t exp_current_value, int64_t exp_hwm_value) {

Callers

nothing calls this directly

Calls 7

ActiveTmpDevicesMethod · 0.80
GetTmpDirPathMethod · 0.80
sizeMethod · 0.45
GetValueMethod · 0.45
valueMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected