sensu / uchiwa

Uchiwa is a simple yet effective open-source dashboard for the Sensu monitoring framework.
https://uchiwa.io
MIT License
920 stars 174 forks source link

Add concurrency to buildClients() #784

Closed amdprophet closed 6 years ago

amdprophet commented 6 years ago

Signed-off-by: Justin Kolberg amd.prophet@gmail.com

Description

Adds concurrency to the buildClients() method.

Related Issue

N/A

Motivation and Context

The buildClients() method takes a significant amount of time to complete with a large number of clients & events. For example, with 18000 clients & events it was taking 2m1.553801286s to complete. With these changes it now takes 21.951286761s.

How Has This Been Tested?

Added some log lines to benchmark performance. Started Uchiwa & verified data was still getting populated.

Screenshots (if appropriate):

Types of changes

Checklist:

teekennedy commented 6 years ago

LGTM

codecov-io commented 6 years ago

Codecov Report

Merging #784 into master will decrease coverage by 0.05%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #784      +/-   ##
==========================================
- Coverage   21.59%   21.54%   -0.06%     
==========================================
  Files          28       28              
  Lines        2454     2460       +6     
==========================================
  Hits          530      530              
- Misses       1859     1865       +6     
  Partials       65       65
Impacted Files Coverage Δ
uchiwa/daemon/clients.go 52.3% <0%> (-5.32%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 815ad56...ee52a00. Read the comment docs.