Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(459)

Unified Diff: src/stats/doc/aggregator.rst

Issue 318800043: Stats module enhancements
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/stats/doc/aggregator.rst
===================================================================
--- a/src/stats/doc/aggregator.rst
+++ b/src/stats/doc/aggregator.rst
@@ -397,3 +397,58 @@
aggregator->Disable ();
}
+
+MultiFileAggregator
+===================
+
+This aggregator sends values it receives to one or more files.
+
+Input
+~~~~~
+
+This class provides 10 methods for receiving input values in `double`. Each
+of these methods is a function with a signature similar to the following:
+
+::
+
+ void WritePd (std::string context, double v1, double v2, ... double vP);
+
+where `P` is a number between 1 and 10. In addition, the class provides the
+method WriteString() which accepts a string input. These input methods
+usually act as trace sinks of output from collectors' trace sources.
+
+Output
+~~~~~~
+
+Each invocation to the input methods described above will produce a single
+line of output. The `double` input arguments will be printed using the
+formatting type selected using SetFileType() method or `FileType` attribute.
+The `string` argument, on the other hand, will be printed as it is.
+
+The first argument of each of the above mentioned input methods is a short
+string indicating the context of the input sample. When the `MultiFileMode`
+attribute is enabled (the default), this aggregator will create an
+individual file for each unique context value, and then send each input
+sample to the corresponding file.
+
+When the `EnableContextPrinting` attribute is enabled (disabled by default),
+each output line will begin with the context string and then a space. This
+style is useful to determine the context of different data when all the
+contexts are mixed together in one file, i.e., when `MultiFileMode` is
+disabled.
+
+The name of every file created begins with the value of the `OutputFileName`
+attribute, and then followed by the context string. Finally, a ".txt"
+extension is added at the end.
+
+Note that all outputs are stored internally in string buffers. Upon destruction,
+e.g., at the end of simulation, the whole buffer content is written to
+the destination files.
+
+Examples
+~~~~~~~~
+
+Statistics helper classes derived from StatsHelper utilize MultiFileAggregator
+to produce separate statistics files for each identifier. User does not necessarily
+need to handle MultiFileaggregator, but rather let the helpers do the complicated tasks.
+

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b