Skip to content
This repository has been archived by the owner on Sep 14, 2023. It is now read-only.

Commit

Permalink
Main json dump (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
damianStrojek committed Jun 8, 2023
1 parent f176b38 commit 9b3d206
Show file tree
Hide file tree
Showing 5 changed files with 3,353 additions and 16,419 deletions.
15 changes: 4 additions & 11 deletions measure-performance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,6 @@ int main(int argc, char **argv){
// Download metrics in constant batches
for(int i = 0; i < DATA_BATCH; i++){

//auto start = std::chrono::high_resolution_clock::now();

getSystemMetrics(allMetrics.systemMetrics);
getProcessorMetrics(allMetrics.processorMetrics);
getInputOutputMetrics(allMetrics.inputOutputMetrics);
Expand All @@ -106,18 +104,13 @@ int main(int argc, char **argv){
&allMetricsArray[j].inputOutputMetrics, &allMetricsArray[j].memoryMetrics, \
&allMetricsArray[j].networkMetrics, &allMetricsArray[j].powerMetrics);
}
jsonArray.push_back(metricsToJson(allMetricsArray,clusterSize));


jsonArray.push_back(metricsToJson(allMetricsArray,clusterSize));
}

//auto end = std::chrono::high_resolution_clock::now();
//auto duration = std::chrono::duration_cast<std::chrono::microseconds>(end-start);
//std::cout << "Time taken to get all measures:" << duration.count() << "microseconds\n";
// Save metrics to file
if(rank==0) outputFile << jsonArray.dump(4);
//writeToJSON(outputFile, allMetrics);
}

// Save metrics to file
if(!rank) outputFile << jsonArray.dump(4);

outputFile.close();
MPI_Type_free(&systemMetricsType);
Expand Down
2 changes: 1 addition & 1 deletion metrics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ void InputOutputMetrics::printInputOutputMetrics(){

void getInputOutputMetrics(InputOutputMetrics &inputOutputMetrics){

const char* command = "awk '{ print $2 }' /proc/$$/io"; // [TODO] Change PID
const char* command = "awk '{ print $2 }' /proc/$$/io";
std::string output = exec(command), temp;
std::stringstream stream(output);

Expand Down
Loading

0 comments on commit 9b3d206

Please sign in to comment.