Skip to content

Conversation

@dimitris-athanasiou
Copy link
Contributor

No description provided.

Copy link

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does CModelSnapshotJsonWriter.cc need updating too?

CPPUNIT_ASSERT_EQUAL(ml::core::CTimeUtils::toEpochMs(ml::core_t::TTime(1)), int64_t(1000));
CPPUNIT_ASSERT_EQUAL(ml::core::CTimeUtils::toEpochMs(ml::core_t::TTime(-1)), int64_t(-1000));
CPPUNIT_ASSERT_EQUAL(ml::core::CTimeUtils::toEpochMs(ml::core_t::TTime(1521035866)), int64_t(1521035866000));
CPPUNIT_ASSERT_EQUAL(ml::core::CTimeUtils::toEpochMs(ml::core_t::TTime(-1521035866)), int64_t(-1521035866000));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The order of arguments should be (expected, actual).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I was testing you :P

{
int64_t javaTimestamp = int64_t(value) * 1000;
TValue v(javaTimestamp);
TValue v(CTimeUtils::toEpochMs(value));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lower down this file, around line 550-555 value * int64_t(1000) can also be changed.

@dimitris-athanasiou
Copy link
Contributor Author

Good catch. Addressed all points.

Copy link

@droberts195 droberts195 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@dimitris-athanasiou dimitris-athanasiou merged commit 7603890 into elastic:master Mar 14, 2018
@dimitris-athanasiou dimitris-athanasiou deleted the encapsulate-timestamp-conversion-from-epoch-seconds-to-epoch-millis branch March 14, 2018 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants