Skip to content

Commit

Permalink
Merge pull request #7 from pvelesko/velesko_fix
Browse files Browse the repository at this point in the history
Velesko fix
  • Loading branch information
guptask authored Apr 8, 2020
2 parents d42cd6b + 43a81d5 commit c8fe87b
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/AggregateEventStatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ void AggregateEventStatistics::record(const std::string& source, unsigned int se
edge_stats_[makeEdge(source, event->receiverName())] += 1;
}

void AggregateEventStatistics::record(const std::string& source, unsigned int send_time,
const std::vector<std::shared_ptr<Event>>& events) {
for (const auto& e : events) {
record(source, send_time, e.get());
}
}


unsigned int AggregateEventStatistics::getStat(const Edge& e) const {
return edge_stats_.at(e);
}
Expand Down
3 changes: 3 additions & 0 deletions src/AggregateEventStatistics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ class AggregateEventStatistics : public EventStatistics {
AggregateEventStatistics(std::string filename, OutputType output_type);

void record(const std::string& source, unsigned int send_time, Event* event);
// Record zero or more events at once
void record(const std::string& source, unsigned int send_time,
const std::vector<std::shared_ptr<Event>>& events);

// Make an undirectional edge connecting two vertices.
Edge makeEdge(const std::string& a, const std::string& b) const;
Expand Down
7 changes: 7 additions & 0 deletions src/IndividualEventStatistics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,13 @@ void IndividualEventStatistics::record(const std::string& source, unsigned int s
event->timestamp(),
event->size() + event->base_size() );
}
void IndividualEventStatistics::record(const std::string& source, unsigned int send_time,
const std::vector<std::shared_ptr<Event>>& events) {
for (const auto& e : events) {
record(source, send_time, e.get());
}
}


std::ostream& IndividualEventStatistics::printStats(std::ostream& stream) const {
if (output_type_ == OutputType::Json) {
Expand Down
2 changes: 2 additions & 0 deletions src/IndividualEventStatistics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ class IndividualEventStatistics : public EventStatistics {

IndividualEventStatistics(std::string filename, OutputType output_type);
void record(const std::string& source, unsigned int send_time, Event* event);
void record(const std::string& source, unsigned int send_time,
const std::vector<std::shared_ptr<Event>>& events);

private:
std::ostream& printStats(std::ostream& stream) const;
Expand Down
7 changes: 7 additions & 0 deletions src/NullEventStatistics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,13 @@ class NullEventStatistics : public EventStatistics {
void record(const std::string& source, unsigned int send_time, Event* event) {
unused(source, send_time, event);
}
void record(const std::string& source, unsigned int send_time,
const std::vector<std::shared_ptr<Event>>& events) {
for (const auto& e : events) {
record(source, send_time, e.get());
}
}


void writeToFile() {}
private:
Expand Down
2 changes: 1 addition & 1 deletion src/TimeWarpEventDispatcher.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef TIME_WARP_EVENT_DISPATCHER_H
#define TIME_WARP_EVENT_DISPATCHER_H

#define THREAD_LOCAL_SPECIFIER _Thread_local
#define THREAD_LOCAL_SPECIFIER thread_local

#ifdef __GNUC__
#if __GNUC_MINOR__ < 8
Expand Down

0 comments on commit c8fe87b

Please sign in to comment.