Skip to content

Commit

Permalink
Update timings - not replace (#392)
Browse files Browse the repository at this point in the history
So that sample period will not be reset every update
  • Loading branch information
martinsumner authored Jan 26, 2023
1 parent cf3d8f5 commit ee6c166
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/leveled_monitor.erl
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ handle_cast({bookie_head_update, FetchTime, RspTime, CacheHit}, State) ->
{FC + 1, FLT, FCT + FetchTime, RST + RspTime, NFT}
end,
UpdTimings =
#bookie_head_timings{
Timings#bookie_head_timings{
sample_count = SC0,
cache_count = CC0,
found_count = FC0,
Expand All @@ -293,7 +293,7 @@ handle_cast({bookie_get_update, HeadTime, BodyTime}, State) ->
Timings#bookie_get_timings.body_time + BodyTime}
end,
UpdTimings =
#bookie_get_timings{
Timings#bookie_get_timings{
sample_count = SC0,
head_time = HT0,
body_time = BT0,
Expand All @@ -308,7 +308,7 @@ handle_cast({bookie_put_update, InkTime, PrepTime, MemTime, Size}, State) ->
PT0 = Timings#bookie_put_timings.prep_time + PrepTime,
MT0 = Timings#bookie_put_timings.mem_time + MemTime,
UpdTimings =
#bookie_put_timings{
Timings#bookie_put_timings{
sample_count = SC0,
ink_time = IT0,
prep_time = PT0,
Expand All @@ -322,7 +322,7 @@ handle_cast({bookie_snap_update, BookieTime, PCLTime}, State) ->
BT0 = Timings#bookie_snap_timings.bookie_time + BookieTime,
PT0 = Timings#bookie_snap_timings.pcl_time + PCLTime,
UpdTimings =
#bookie_snap_timings{
Timings#bookie_snap_timings{
sample_count = SC0,
bookie_time = BT0,
pcl_time = PT0
Expand Down Expand Up @@ -436,7 +436,7 @@ handle_cast({cdb_get_update, CycleCount, IndexTime, ReadTime}, State) ->
IT0 = Timings#cdb_get_timings.index_time + IndexTime,
RT0 = Timings#cdb_get_timings.read_time + ReadTime,
UpdTimings =
#cdb_get_timings{
Timings#cdb_get_timings{
sample_count = SC0,
cycle_count = CC0,
index_time = IT0,
Expand Down

0 comments on commit ee6c166

Please sign in to comment.