Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPL: increase max size of string metrics to 256 bytes #5168

Merged
merged 1 commit into from Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion Framework/Core/include/Framework/DeviceMetricsInfo.h
Expand Up @@ -43,7 +43,7 @@ struct MetricInfo {
// We keep only fixed lenght strings for metrics, as in the end this is not
// really needed. They should be nevertheless 0 terminated.
struct StringMetric {
static constexpr ptrdiff_t MAX_SIZE = 128;
static constexpr ptrdiff_t MAX_SIZE = 256;
char data[MAX_SIZE];
};

Expand Down
21 changes: 21 additions & 0 deletions Framework/Core/test/test_DeviceMetricsInfo.cxx
Expand Up @@ -128,6 +128,27 @@ BOOST_AUTO_TEST_CASE(TestDeviceMetricsInfo)
BOOST_CHECK_EQUAL(result, true);
result = DeviceMetricsHelper::processMetric(match, info);
BOOST_CHECK_EQUAL(result, true);
BOOST_CHECK_EQUAL(info.metricLabelsIdx.size(), 4);
BOOST_CHECK_EQUAL(info.metrics.size(), 4);
BOOST_CHECK_EQUAL(info.stringMetrics.size(), 1);
BOOST_CHECK_EQUAL(info.metrics[3].type, MetricType::String);
BOOST_CHECK_EQUAL(info.metrics[3].storeIdx, 0);
BOOST_CHECK_EQUAL(info.metrics[3].pos, 1);

// Parse a string metric with a file description in it
memset(&match, 0, sizeof(match));
metric = "[METRIC] alien-file-name,1 alien:///alice/data/2015/LHC15o/000244918/pass5_lowIR/PWGZZ/Run3_Conversion/96_20201013-1346_child_1/0028/AO2D.root:/,631838549,ALICE::CERN::EOS 1789372895 hostname=test.cern.ch";
result = DeviceMetricsHelper::parseMetric(metric, match);
BOOST_CHECK_EQUAL(result, true);
result = DeviceMetricsHelper::processMetric(match, info);
BOOST_CHECK_EQUAL(result, true);
BOOST_CHECK_EQUAL(info.metricLabelsIdx.size(), 5);
BOOST_CHECK_EQUAL(info.metrics.size(), 5);
BOOST_CHECK_EQUAL(info.stringMetrics.size(), 2);
BOOST_CHECK_EQUAL(info.metrics[4].type, MetricType::String);
BOOST_CHECK_EQUAL(info.metrics[4].storeIdx, 1);
BOOST_CHECK_EQUAL(info.metrics[4].pos, 1);
BOOST_CHECK_EQUAL(std::string(info.stringMetrics[1][0].data), std::string("alien:///alice/data/2015/LHC15o/000244918/pass5_lowIR/PWGZZ/Run3_Conversion/96_20201013-1346_child_1/0028/AO2D.root:/,631838549,ALICE::CERN::EOS"));
}

BOOST_AUTO_TEST_CASE(TestDeviceMetricsInfo2)
Expand Down