Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

more indentation cleanup

  • Loading branch information...
commit 40604cf120074bd93d6f9b85ccb338025f553312 1 parent 56dff0a
Dmitry Groshev si14 authored

Showing 1 changed file with 9 additions and 9 deletions. Show diff stats Hide diff stats

  1. +9 9 src/jn_mavg.erl
18 src/jn_mavg.erl
@@ -96,15 +96,15 @@ bump_mavg(MA, Events, T) when
96 96 Elapsed =:= 0 -> MA#mavg{unprocessedEvents = HoldEvs + Events,
97 97 eventCounter = UpdatedCounter };
98 98 Elapsed < (8 * Period), Elapsed > 0 ->
99   - % Integrate HoldEvs, since they're for a single period
100   - HoldAvg = (Average - HoldEvs) * math:exp(-1/Period) + HoldEvs,
101   - % Integrate zero-filled periods, of which there are (Elapsed-1)
102   - ZeroAvg = HoldAvg * math:exp((1-Elapsed)/Period),
103   - MA#mavg{unprocessedEvents = Events, historicAvg = ZeroAvg,
104   - lastupdatets = T, eventCounter = UpdatedCounter };
105   - true ->
106   - MA#mavg{unprocessedEvents = Events, historicAvg = 0.0,
107   - lastupdatets = T, eventCounter = UpdatedCounter }
  99 + %% Integrate HoldEvs, since they're for a single period
  100 + HoldAvg = (Average - HoldEvs) * math:exp(-1/Period) + HoldEvs,
  101 + %% Integrate zero-filled periods, of which there are (Elapsed-1)
  102 + ZeroAvg = HoldAvg * math:exp((1-Elapsed)/Period),
  103 + MA#mavg{unprocessedEvents = Events, historicAvg = ZeroAvg,
  104 + lastupdatets = T, eventCounter = UpdatedCounter };
  105 + true ->
  106 + MA#mavg{unprocessedEvents = Events, historicAvg = 0.0,
  107 + lastupdatets = T, eventCounter = UpdatedCounter }
108 108 end.
109 109
110 110 updateEventCounter(Events, EventsCounter, NowTS, Period) ->

0 comments on commit 40604cf

Please sign in to comment.
Something went wrong with that request. Please try again.