Skip to content

Commit

Permalink
Fix some wrong assumptions about the event rate
Browse files Browse the repository at this point in the history
Realized: 9 is the rate that means "log always". Elevate some rare but
important events to rate 9.
  • Loading branch information
eugeneia committed Dec 7, 2018
1 parent 30cafdc commit e5faba0
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
8 changes: 4 additions & 4 deletions src/core/app.events
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
1,6|started:
1,9|started:
The app has been started. (Returned from new() callback.)

1,6|linked:
1,9|linked:
The app has been linked. (Returned from link() callback.)

1,6|reconfigured:
1,9|reconfigured:
The app has been reconfigured. (Returned from reconfig() callback.)

1,6|stopped:
1,9|stopped:
The app has been stopped. (Returned from stop() callback.)


Expand Down
6 changes: 3 additions & 3 deletions src/core/app.lua
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ local timeline_log, events -- initialized on demand
function timeline ()
if timeline_log == nil then
timeline_log = timeline_mod.new("engine/timeline")
timeline_mod.rate(timeline_log, 7) -- initialize rate to "no logging"
timeline_mod.rate(timeline_log, 9) -- initially log events with rate >= 9
events = timeline_mod.load_events(timeline_log, "core.engine")
end
return timeline_log
Expand All @@ -59,7 +59,7 @@ function randomize_log_rate ()
-- Could be better to reduce the log rate over time to "stretch"
-- logs for long running processes? Improvements possible :-).
--
-- We use rates 0-6 where 6 means "log always", and 0 means "log never."
-- We use rates 0-9 where 9 means "log always", and 0 means "log never."
local rate = math.max(1, math.ceil(math.log(math.random(5^9))/math.log(5)))
timeline_mod.rate(timeline_log, rate)
end
Expand Down Expand Up @@ -450,7 +450,7 @@ function apply_config_actions (actions)
events.config_applied()

compute_breathe_order ()
events.breath_order_computed()
events.breathe_order_computed()
end

-- Sort the NODES topologically according to SUCCESSORS via
Expand Down
10 changes: 5 additions & 5 deletions src/core/engine.events
Original file line number Diff line number Diff line change
Expand Up @@ -63,16 +63,16 @@ The engine resumes operation after sleeping voluntarily.
The engine stops the traffic processing loop.


0,6|config_actions_computed:
0,9|config_actions_computed:
The engine has computed the actions required for applying a new configuration.

0,6|configure: config
0,9|configure: config
The engine begins to apply a new configuration.

'config' is the number of this configuration.

0,6|config_applied:
0,9|config_applied:
The engine has applied a new configuration.

0,6|breath_order_computed:
The engine has computed the breath order of a new configuration.
0,9|breathe_order_computed:
The engine has computed the breath order of a new configuration.
4 changes: 2 additions & 2 deletions src/core/packet.events
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
9,6|packets_preallocated: packets
DMA memory for packets had been preallocated from the operating system.
9,9|packets_preallocated: packets
DMA memory for packets has been preallocated from the operating system.

'packets' is the number of packets for which space has been reserved.

Expand Down

0 comments on commit e5faba0

Please sign in to comment.