HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PDG_WorkItemStats.h
Go to the documentation of this file.
1 /*
2 * PROPRIETARY INFORMATION. This software is proprietary to
3 * Side Effects Software Inc., and is not to be reproduced,
4 * transmitted, or disclosed in any way without written permission.
5 *
6 * COMMENTS:
7 */
8 
9 #ifndef __PDG_WORKITEMSTATS_H__
10 #define __PDG_WORKITEMSTATS_H__
11 
12 #include "PDG_API.h"
13 #include "PDG_Types.h"
14 
15 /*
16  * Helper struct for storing basic work item stats, like cook times and
17  * output file size
18  */
20 {
21 public:
22  /// Enumeration of stats stored in this object
23  enum StatType
24  {
25  /// The time at which the work item was submitted to the PDG
26  /// scheduler queue
28 
29  /// The time at which the work item was passed to the
30  /// onSchedule call for the active scheduler
32 
33  /// The time at which the work item began cooking. For scheduled
34  /// items, this is set when the startCook message is recevied, not
35  /// when the item is scheduled.
37 
38  /// The time at which the work item completed cooking.
40 
41  /// The total file size of all outputs on the work item
43 
44  /// The number of tracked stats
45  eStatCount
46  };
47 
48 public:
49  /// Constructs and zero-initializes the stat object
51 
52  /// Resets all stats on the work item
53  void reset();
54 
55  /// Returns the current value of the specified stat type
56  fpreal getStat(StatType stat) const;
57 
58  /// Sets the value of the specified stat type
59  fpreal setStat(StatType stat, fpreal value);
60 
61  /// Sets the value of the specified stat to the current time
62  fpreal setTimeStat(StatType stat);
63 
64  /// Returns the cook duration for the work item. e.g. the time spent
65  /// between starting and stopping cooking
66  fpreal cookDuration() const;
67 
68  /// Sets the service client used to cook the work item
69  void setServiceClient(const UT_StringHolder& client)
70  { myServiceClient = client; }
71 
72  /// Returns the service client name used to cook this work item, or empty
73  /// string if the work item didn't cook using services
75  { return myServiceClient; }
76 
77 private:
78  fpreal myStats[eStatCount];
79  UT_StringHolder myServiceClient;
80 };
81 
82 #endif
#define PDG_API
Definition: PDG_API.h:23
const UT_StringHolder & serviceClient() const
GLboolean reset
Definition: glad.h:5138
The time at which the work item completed cooking.
StatType
Enumeration of stats stored in this object.
The total file size of all outputs on the work item.
fpreal64 fpreal
Definition: SYS_Types.h:277
void setServiceClient(const UT_StringHolder &client)
Sets the service client used to cook the work item.
Definition: core.h:1131