-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Kassiopeia: Add processing duration as output fields
To understand which steps and tracks take long to calculate, this commit adds new output fields `processing_duration` to Tracks, Steps, Events and Runs. This replaces the old processing time calculation of KSRuns used to print the estimated remaining time into the log since that can re-use the newly added timings. However this excludes a minor bit of clean-up code after the run processing from the respective timing.
- Loading branch information
Showing
13 changed files
with
94 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#ifndef Kassiopeia_KSTimed_h_ | ||
#define Kassiopeia_KSTimed_h_ | ||
|
||
#include <chrono> | ||
|
||
namespace Kassiopeia | ||
{ | ||
|
||
class KSTimed { | ||
private: | ||
std::chrono::steady_clock::time_point fTimeStart; | ||
double fProcessingDuration = -1; | ||
|
||
public: | ||
void StartTiming(); | ||
void EndTiming(); | ||
|
||
const double& GetProcessingDuration() const {return fProcessingDuration;}; | ||
}; | ||
|
||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "KSTimed.h" | ||
|
||
namespace Kassiopeia | ||
{ | ||
|
||
void KSTimed::StartTiming() { | ||
fTimeStart = std::chrono::steady_clock::now(); | ||
fProcessingDuration = -1; | ||
} | ||
|
||
void KSTimed::EndTiming() { | ||
std::chrono::steady_clock::time_point tTimeEnd = std::chrono::steady_clock::now(); | ||
fProcessingDuration = std::chrono::duration_cast<std::chrono::duration<double>>(tTimeEnd - fTimeStart).count(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters