Skip to content

Commit

Permalink
moved Event.setTimestamp call to c interface layer
Browse files Browse the repository at this point in the history
  • Loading branch information
haukeduden committed Jun 27, 2022
1 parent 603d2fe commit 358a4b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 0 additions & 8 deletions include/countly.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,16 +197,12 @@ class Countly {
void RecordEvent(const std::string key, int count, double sum) {
Event ev(key, count, sum);

ev.setTimestamp();

addEvent(ev);
}

void RecordEvent(const std::string key, std::map<std::string, std::string> segmentation, int count) {
Event event(key, count);

event.setTimestamp();

for (auto key_value: segmentation) {
event.addSegmentation(key_value.first, key_value.second);
}
Expand All @@ -217,8 +213,6 @@ class Countly {
void RecordEvent(const std::string key, std::map<std::string, std::string> segmentation, int count, double sum) {
Event event(key, count, sum);

event.setTimestamp();

for (auto key_value: segmentation) {
event.addSegmentation(key_value.first, key_value.second);
}
Expand All @@ -229,8 +223,6 @@ class Countly {
void RecordEvent(const std::string key, std::map<std::string, std::string> segmentation, int count, double sum, double duration) {
Event event(key, count, sum, duration);

event.setTimestamp();

for (auto key_value: segmentation) {
event.addSegmentation(key_value.first, key_value.second);
}
Expand Down
4 changes: 4 additions & 0 deletions src/countly_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ extern "C" int countly_c_recordEvent(
if(screenName!=NULL && screenName[0]!=0) {
ev.addSegmentation("view", std::string(screenName));
}

ev.setTimestamp()

Countly::getInstance().addEvent(ev);

Expand All @@ -166,6 +168,8 @@ extern "C" int countly_c_recordScreenView(
initEventSegmentation(ev, segmentationParams, segmentationParamCount);
ev.addSegmentation("name", std::string(screenName));

ev.setTimestamp()

Countly::getInstance().addEvent(ev);

COUNTLY_C_GUARD_END
Expand Down

0 comments on commit 358a4b6

Please sign in to comment.