Skip to content

Commit c850534

Browse files
committed
[metrics,status] Drop csv output
1 parent c7c8257 commit c850534

File tree

3 files changed

+7
-45
lines changed

3 files changed

+7
-45
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ CRORC.
377377
Output may be in ASCII table (default), or JSON format (`--json-out` option). Example outputs can be found [here](doc/examples/roc-list-cards/).
378378
379379
### roc-metrics
380-
Outputs metrics for the ReadoutCards. Output may be in an ASCII table (default), in JSON (`--json-out` option), or CSV format (`--csv-out` option). Example outputs can be found [here](doc/examples/roc-metrics/).
380+
Outputs metrics for the ReadoutCards. Output may be in an ASCII table (default) or in JSON (`--json-out` option) format. Example outputs can be found [here](doc/examples/roc-metrics/).
381381
382382
Parameter information can be extracted from the monitoring table below.
383383
@@ -422,7 +422,7 @@ Run a Python script that can use a simple interface to use the library.
422422
Setup hugetlbfs directories & mounts. If using hugepages, should be run once per boot.
423423
424424
### roc-status
425-
Reports status on the card's global and per-link configuration. Output may be in an ASCII table (default), in JSON (`--json-out` option), or CSV format (`--csv-out` option). Example outputs can be found [here](doc/examples/roc-status/).
425+
Reports status on the card's global and per-link configuration. Output may be in an ASCII table (default) or in JSON (`--json-out` option) format. Example outputs can be found [here](doc/examples/roc-status/).
426426
427427
Parameter information can be extracted from the monitoring tables below. Please note that for "UP/DOWN" and "Enabled/Disabled"
428428
states while the monitoring format is an int (0/1), in all other formats a string representation is used.

src/CommandLineUtilities/ProgramMetrics.cxx

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ class ProgramMetrics : public Program
5050
options.add_options()("json-out",
5151
po::bool_switch(&mOptions.jsonOut),
5252
"Toggle json-formatted output");
53-
options.add_options()("csv-out",
54-
po::bool_switch(&mOptions.csvOut),
55-
"Toggle csv-formatted output");
5653
options.add_options()("monitoring",
5754
po::bool_switch(&mOptions.monitoring),
5855
"Toggle monitoring metrics sending");
@@ -68,10 +65,7 @@ class ProgramMetrics : public Program
6865
auto lineFat = std::string(header.length(), '=') + '\n';
6966
auto lineThin = std::string(header.length(), '-') + '\n';
7067

71-
if (mOptions.csvOut) {
72-
auto csvHeader = "#,Type,PCI Addr,Serial,Endpoint,Temp (C),#Dropped Packets,CTP Clock (MHz),Local Clock (MHz),Total Packets per second\n";
73-
std::cout << csvHeader;
74-
} else if (!mOptions.jsonOut) {
68+
if (!mOptions.jsonOut) {
7569
table << lineFat << header << lineThin;
7670
}
7771

@@ -131,12 +125,6 @@ class ProgramMetrics : public Program
131125

132126
// add the card node to the tree
133127
root.add_child(std::to_string(i), cardNode);
134-
} else if (mOptions.csvOut) {
135-
auto csvLine = std::to_string(i) + "," + CardType::toString(card.cardType) + "," + card.pciAddress.toString() + "," +
136-
std::to_string(card.serialId.getSerial()) + "," + std::to_string(card.serialId.getEndpoint()) + "," +
137-
std::to_string(temperature) + "," + std::to_string(dropped) + "," + std::to_string(ctpClock) + "," +
138-
std::to_string(localClock) + "," + std::to_string(totalPacketsPerSecond) + "\n";
139-
std::cout << csvLine;
140128
} else {
141129
auto format = boost::format(formatRow) % i % CardType::toString(card.cardType) % card.pciAddress.toString() % card.serialId.getSerial() % card.serialId.getEndpoint() % temperature % dropped % ctpClock % localClock % totalPacketsPerSecond;
142130

@@ -147,7 +135,7 @@ class ProgramMetrics : public Program
147135

148136
if (mOptions.jsonOut) {
149137
pt::write_json(std::cout, root);
150-
} else if (!mOptions.csvOut && !mOptions.monitoring) {
138+
} else if (!mOptions.monitoring) {
151139
auto lineFat = std::string(header.length(), '=') + '\n';
152140
table << lineFat;
153141
std::cout << table.str();
@@ -157,7 +145,6 @@ class ProgramMetrics : public Program
157145
private:
158146
struct OptionsStruct {
159147
bool jsonOut = false;
160-
bool csvOut = false;
161148
bool monitoring = false;
162149
} mOptions;
163150
};

src/CommandLineUtilities/ProgramStatus.cxx

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class ProgramStatus : public Program
4343
return { "Status", "Return current RoC configuration status",
4444
"roc-status --id 42:00.0\n"
4545
"roc-status --id 42:00.0 --json\n"
46-
"roc-status --id 42:00.0 --csv\n"
4746
"roc-status --id 42:00.0 --monitoring\n" };
4847
}
4948

@@ -53,9 +52,6 @@ class ProgramStatus : public Program
5352
options.add_options()("json-out",
5453
po::bool_switch(&mOptions.jsonOut),
5554
"Toggle json-formatted output");
56-
options.add_options()("csv-out",
57-
po::bool_switch(&mOptions.csvOut),
58-
"Toggle csv-formatted output");
5955
options.add_options()("monitoring",
6056
po::bool_switch(&mOptions.monitoring),
6157
"Toggle monitoring metrics sending");
@@ -94,10 +90,7 @@ class ProgramStatus : public Program
9490
lineFat = std::string(header.length(), '=') + '\n';
9591
lineThin = std::string(header.length(), '-') + '\n';
9692

97-
if (mOptions.csvOut) {
98-
auto csvHeader = "Link ID,Status,Optical Power(uW),QSFP Enabled,Offset,Time Frame Detection, Time Frame Length\n";
99-
std::cout << csvHeader;
100-
} else if (!mOptions.jsonOut) {
93+
if (!mOptions.jsonOut) {
10194
table << lineFat << header << lineThin;
10295
}
10396

@@ -129,10 +122,6 @@ class ProgramStatus : public Program
129122
root.put("offset", offset);
130123
root.put("timeFrameDetection", timeFrameDetectionEnabled);
131124
root.put("timeFrameLength", reportInfo.timeFrameLength);
132-
} else if (mOptions.csvOut) {
133-
auto csvLine = std::string(",,,") + qsfpEnabled + "," + offset + "," + timeFrameDetectionEnabled + "," + std::to_string(reportInfo.timeFrameLength) + "\n";
134-
135-
std::cout << csvLine;
136125
} else {
137126
std::cout << "-----------------------------" << std::endl;
138127
std::cout << "QSFP " << qsfpEnabled << std::endl;
@@ -169,9 +158,6 @@ class ProgramStatus : public Program
169158

170159
// add the link node to the tree
171160
root.add_child(std::to_string(id), linkNode);
172-
} else if (mOptions.csvOut) {
173-
auto csvLine = std::to_string(id) + "," + linkStatus + "," + std::to_string(opticalPower) + "\n";
174-
std::cout << csvLine;
175161
} else {
176162
auto format = boost::format(formatRow) % id % linkStatus % opticalPower;
177163
table << format;
@@ -188,10 +174,7 @@ class ProgramStatus : public Program
188174
auto bar2 = ChannelFactory().getBar(params);
189175
auto cruBar2 = std::dynamic_pointer_cast<CruBar>(bar2);
190176

191-
if (mOptions.csvOut) {
192-
auto csvHeader = "Link ID,GBT Mode,Loopback,GBT Mux,Datapath Mode,Datapath,RX Freq(MHz),TX Freq(MHz),Status,Optical Power(uW),Clock,Offset,UserLogic,RunStats\n";
193-
std::cout << csvHeader;
194-
} else if (!mOptions.jsonOut) {
177+
if (!mOptions.jsonOut) {
195178
table << lineFat << header << lineThin;
196179
}
197180

@@ -226,9 +209,6 @@ class ProgramStatus : public Program
226209
root.put("userLogic", userLogic);
227210
root.put("runStats", runStats);
228211
root.put("userAndCommonLogic", userAndCommonLogic);
229-
} else if (mOptions.csvOut) {
230-
auto csvLine = ",,,,,,,,,," + clock + "," + offset + "," + userLogic + "," + runStats + "\n";
231-
std::cout << csvLine;
232212
} else {
233213
std::cout << "-----------------------------" << std::endl;
234214
std::cout << "CRU ID: " << reportInfo.cruId << std::endl;
@@ -370,10 +350,6 @@ class ProgramStatus : public Program
370350

371351
// add the link node to the tree
372352
root.add_child(std::to_string(globalId), linkNode);
373-
} else if (mOptions.csvOut) {
374-
auto csvLine = std::to_string(globalId) + "," + gbtTxRxMode + "," + loopback + "," + gbtMux + "," + datapathMode + "," + enabled + "," +
375-
std::to_string(rxFreq) + "," + std::to_string(txFreq) + "," + linkStatus + "," + std::to_string(opticalPower) + "\n";
376-
std::cout << csvLine;
377353
} else {
378354
auto format = boost::format(formatRow) % globalId % gbtTxRxMode % loopback % gbtMux % datapathMode % enabled % rxFreq % txFreq % linkStatus % opticalPower;
379355
table << format;
@@ -386,7 +362,7 @@ class ProgramStatus : public Program
386362

387363
if (mOptions.jsonOut) {
388364
pt::write_json(std::cout, root);
389-
} else if (!mOptions.csvOut && !mOptions.monitoring) {
365+
} else if (!mOptions.monitoring) {
390366
auto lineFat = std::string(header.length(), '=') + '\n';
391367
table << lineFat;
392368
std::cout << table.str();
@@ -396,7 +372,6 @@ class ProgramStatus : public Program
396372
private:
397373
struct OptionsStruct {
398374
bool jsonOut = false;
399-
bool csvOut = false;
400375
bool monitoring = false;
401376
bool onu = false;
402377
} mOptions;

0 commit comments

Comments
 (0)