MCPcopy Create free account
hub / github.com/Icinga/icinga2 / EvenMinutesTimePeriodUpdate

Method EvenMinutesTimePeriodUpdate

lib/methods/timeperiodtask.cpp:20–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18}
19
20Array::Ptr TimePeriodTask::EvenMinutesTimePeriodUpdate(const TimePeriod::Ptr& tp, double begin, double end)
21{
22 REQUIRE_NOT_NULL(tp);
23
24 ArrayData segments;
25
26 for (long t = begin / 60 - 1; t * 60 < end; t++) {
27 if ((t % 2) == 0) {
28 segments.push_back(new Dictionary({
29 { "begin", t * 60 },
30 { "end", (t + 1) * 60 }
31 }));
32 }
33 }
34
35 return new Array(std::move(segments));
36}

Callers

nothing calls this directly

Calls 1

push_backMethod · 0.80

Tested by

no test coverage detected