Skip to content

Documentation Issue: Aws::CloudWatch::Model::MetricDatum does not specify the units of the "timestamp" field #28

Closed
@ghost

Description

The "timestamp" field of a CloudWatch MetricDatum is used to tag a piece of data with the time at which it occurred. The AWS SDK CPP specifies this timestamp field as a double type, but does not indicate what the double actually represents.

Here is the current documentation from the MetricDatum.h file:

/*
     <p> The time stamp used for the metric. If not specified, the default value is set to the time the metric data was received. Amazon CloudWatch uses Coordinated Universal Time (UTC) when returning time stamps, which do not accommodate seasonal adjustments such as daylight savings time. For more information, see <a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp">Time stamps</a> in the <i>Amazon CloudWatch Developer Guide</i>. </p>
    */
    inline double GetTimestamp() const{ return m_timestamp; }

    /*
     <p> The time stamp used for the metric. If not specified, the default value is set to the time the metric data was received. Amazon CloudWatch uses Coordinated Universal Time (UTC) when returning time stamps, which do not accommodate seasonal adjustments such as daylight savings time. For more information, see <a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp">Time stamps</a> in the <i>Amazon CloudWatch Developer Guide</i>. </p>
    */
    inline void SetTimestamp(double value) { m_timestampHasBeenSet = true; m_timestamp = value; }

    /*
     <p> The time stamp used for the metric. If not specified, the default value is set to the time the metric data was received. Amazon CloudWatch uses Coordinated Universal Time (UTC) when returning time stamps, which do not accommodate seasonal adjustments such as daylight savings time. For more information, see <a href="http://docs.aws.amazon.com/AmazonCloudWatch/latest/DeveloperGuide/cloudwatch_concepts.html#about_timestamp">Time stamps</a> in the <i>Amazon CloudWatch Developer Guide</i>. </p>
    */
    inline MetricDatum& WithTimestamp(double value) { SetTimestamp(value); return *this;}

Should the double be interpreted as milliseconds since the 1970 epoch? Or seconds? Or something else entirely? CloudWatch itself expects an 8601 ISO formatted timestamp, so it is not entirely clear how this double field maps onto that timestamp.

Alternately, would it make sense to have a variant of the setters for timestamp that takes in a std::chrono::time_point (http://en.cppreference.com/w/cpp/chrono/time_point) object?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions