30 #ifndef GOOGLE_DATAFLOW_API_CPUT_IME_H_ 31 #define GOOGLE_DATAFLOW_API_CPUT_IME_H_ 34 #include "googleapis/base/integral_types.h" 35 #include "googleapis/base/macros.h" 36 #include "googleapis/client/data/jsoncpp_data.h" 37 #include "googleapis/strings/stringpiece.h" 51 class CPUTime :
public client::JsonCppData {
65 explicit CPUTime(
const Json::Value& storage);
72 explicit CPUTime(Json::Value* storage);
85 return StringPiece(
"google_dataflow_api::CPUTime");
94 return Storage().isMember(
"rate");
101 MutableStorage()->removeMember(
"rate");
109 const Json::Value& storage = Storage(
"rate");
110 return client::JsonValueToCppValueHelper<double >(storage);
122 client::SetJsonValueFromCppValueHelper<double >(
123 value, MutableStorage(
"rate"));
132 return Storage().isMember(
"timestamp");
139 MutableStorage()->removeMember(
"timestamp");
147 const Json::Value& v = Storage(
"timestamp");
148 if (v == Json::Value::null)
return StringPiece(
"");
149 return StringPiece(v.asCString());
160 *MutableStorage(
"timestamp") = value.data();
169 return Storage().isMember(
"totalMs");
176 MutableStorage()->removeMember(
"totalMs");
184 const Json::Value& storage = Storage(
"totalMs");
185 return client::JsonValueToCppValueHelper<uint64 >(storage);
197 client::SetJsonValueFromCppValueHelper<uint64 >(
198 value, MutableStorage(
"totalMs"));
202 void operator=(
const CPUTime&);
205 #endif // GOOGLE_DATAFLOW_API_CPUT_IME_H_ void clear_timestamp()
Definition: cput_ime.h:138
void clear_total_ms()
Definition: cput_ime.h:175
Definition: cput_ime.h:51
void clear_rate()
Definition: cput_ime.h:100
bool has_total_ms() const
Definition: cput_ime.h:168
Definition: approximate_progress.h:40
double get_rate() const
Definition: cput_ime.h:108
uint64 get_total_ms() const
Definition: cput_ime.h:183
void set_total_ms(uint64 value)
Definition: cput_ime.h:196
void set_timestamp(const StringPiece &value)
Definition: cput_ime.h:159
const StringPiece GetTypeName() const
Definition: cput_ime.h:84
bool has_rate() const
Definition: cput_ime.h:93
Definition: approximate_progress.cc:42
void set_rate(double value)
Definition: cput_ime.h:121
bool has_timestamp() const
Definition: cput_ime.h:131
const StringPiece get_timestamp() const
Definition: cput_ime.h:146