I have a class that oversees some process. At it's core, there is a process
method which collects data and processes it. There are a bunch of methods for retrieving the results of the previous processing step.
To have a better overview, here is how it looks like currently:
class Main {
private:
// resource1, resource2 ...
// result1, result2
public:
void process() {
resource1.getData();
resource2.getData();
// process data
// store results
}
T getResult1() {
return result1;
}
};
The users of this class are supposed to use it like this:
Main main(resource1, resource2);
while (condition) {
main.process();
output main.getResult1();
}
(I'd appreciate any comments about the current architecture too)
Now, the data comes in chunks, and the processing is done on a per-chunk basis. The idea is to insert some metrics in the class, that track the processing over time.
Requirements from the metric system:
- Should be able to store information over time
- Should provide some way of configuring the metrics used, as well as some functionality to clear a metric
- As separated as possible from the Main class
- The metrics need access to the results of the processing and various members of the main class
- There is a relatively small number of metrics (less than 10) currently considered
- The user of the main class should have access to the metrics all the time
One way would be to store the metrics inside Main (maybe inside a MetricManager class), and run them after each processing stage. The problem is that they need access to a lot of components from Main (maybe passing this as parameter would be an option?).