-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reduce log spam: gated logging for high frequency items. #35
Conversation
@alvasw Could you please review this PR? Thank you. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea to reduce logging of high frequency items! 👍
lowerBound, | ||
upperBound, | ||
priceAvg); | ||
if (logOutliers) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You wouldn't need to add a new method argument and pass the boolean to priceAverageWithOutliersRemoved
if you move boolean maybeLogDetails = gatedLogging.gatingOperation();
from line 91 to line 150.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alvasw : The decision to log has to be taken outside of that loop because we want to log a complete batch of outlier information together. If it were inside the loop the decision would be tested repeatedly, resulting in only the first line logged which does not achieve the purpose.
e.g. desired output when it is time to log:
Oct-25 21:30:22.970 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: KRAKEN DOGE outlier price removed:2.03E-6, lower/upper bounds:2.02E-6/2.021E-6, consensus price:2.0203333333333334E-6
Oct-25 21:30:22.971 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: KRAKEN DASH outlier price removed:8.0E-4, lower/upper bounds:8.02E-4/8.03E-4, consensus price:8.025E-4
Oct-25 21:30:22.971 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: IndependentReserve AUD outlier price removed:55266.32, lower/upper bounds:55336.586/55409.0, consensus price:55372.793000000005
Oct-25 21:30:22.971 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: BTCMARKETS AUD outlier price removed:55433.84, lower/upper bounds:55336.586/55409.0, consensus price:55372.793000000005
Oct-25 21:30:22.971 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: BITFINEX TRY outlier price removed:746320.0, lower/upper bounds:977308.448/981000.0, consensus price:979154.2239999999
Oct-25 21:30:22.971 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: BITFINEX EUR outlier price removed:32963.0, lower/upper bounds:32922.0/32925.82, consensus price:32923.64125
Oct-25 21:30:22.972 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: BTCMARKETS LTC outlier price removed:0.002, lower/upper bounds:0.001988/0.001992, consensus price:0.001989608333333333
Oct-25 21:30:22.972 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: CRYPTOYA: ripioexchange ARS outlier price removed:3.991349663E7, lower/upper bounds:3.132673138E7/3.46499979E7, consensus price:3.223392967352302E7
Oct-25 21:30:22.972 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: CRYPTOYA: cryptomkt ARS outlier price removed:3.746764154E7, lower/upper bounds:3.132673138E7/3.46499979E7, consensus price:3.223392967352302E7
Oct-25 21:30:22.972 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: COINGECKO JPY outlier price removed:5221749.391, lower/upper bounds:5214269.0/5219600.0, consensus price:5216934.5
Oct-25 21:30:22.972 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: KRAKEN JPY outlier price removed:5213293.0, lower/upper bounds:5214269.0/5219600.0, consensus price:5216934.5
Oct-25 21:30:22.972 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: BITFINEX GBP outlier price removed:28764.0, lower/upper bounds:28721.0/28732.442, consensus price:28728.5855
Oct-25 21:30:22.972 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: BITSTAMP USDT-E outlier price removed:2.883E-5, lower/upper bounds:2.882E-5/2.882E-5, consensus price:2.882E-5
Oct-25 21:30:22.972 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: KRAKEN USDT-E outlier price removed:2.881E-5, lower/upper bounds:2.882E-5/2.882E-5, consensus price:2.882E-5
Oct-25 21:30:22.973 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: BITFINEX USD outlier price removed:34730.0, lower/upper bounds:34713.6/34720.0, consensus price:34716.0936
Oct-25 21:30:22.973 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: COINBASEPRO ETC outlier price removed:4.77E-4, lower/upper bounds:4.71E-4/4.72E-4, consensus price:4.7138E-4
Oct-25 21:30:22.973 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: BTCMARKETS ETH outlier price removed:0.0518373, lower/upper bounds:0.05161/0.0517, consensus price:0.05165059428571429
Oct-25 21:30:22.973 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: KRAKEN ZEC outlier price removed:7.9E-4, lower/upper bounds:7.92E-4/7.94E-4, consensus price:7.931133333333333E-4
Oct-25 21:30:22.973 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: BITFINEX XMR outlier price removed:0.0046327, lower/upper bounds:0.00463/0.00463, consensus price:0.00463
Oct-25 21:30:22.973 [http-nio-8080-exec-1] INFO b.p.s.ExchangeRateService: POLO XMR outlier price removed:0.004627, lower/upper bounds:0.00463/0.00463, consensus price:0.00463
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right! That makes sense.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utACK
Recent log investigation showed that anything logged in response to client requests can be a problem because client requests are hundreds or thousands more frequent than the back end of the pricenode (interaction with providers). Logging outlier and blue rate transformations quickly fills the log, using up disk space and preventing analysis of other issues.
This PR implements a gating mechanism for selected logging. The result is logging of outlier and blue rate transformations is reduced to one per minute instead of hundreds per minute.