Skip to content

Instantly share code, notes, and snippets.

@dhurley14
Created June 24, 2020 02:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dhurley14/1a0848e122518b1528cc8e96028108a6 to your computer and use it in GitHub Desktop.
Save dhurley14/1a0848e122518b1528cc8e96028108a6 to your computer and use it in GitHub Desktop.
timing results between master and rbac pr

On master (e2ab94060a6156ebe7170469fbfd22ec8addd87d)

1.2 seconds upper bound for rules table on the UI to load without any rules The below is just the API

$ time ./get_prepackaged_rules_status.sh 
{
  "rules_custom_installed": 0,
  "rules_installed": 0,
  "rules_not_installed": 145,
  "rules_not_updated": 0
}

real	0m0.513s
user	0m0.029s
sys	0m0.010s

3.842 seconds upper bound to install prepackaged rules via UI API calls below

$ time ./get_prepackaged_rules_status.sh 
{
  "rules_custom_installed": 0,
  "rules_installed": 145,
  "rules_not_installed": 0,
  "rules_not_updated": 0
}

real	0m0.768s
user	0m0.029s
sys	0m0.011s
$
$
$
$
$
$ # below finds all the prepackaged rules and prints them out
$ time ./find_rule_by_filter.sh "alert.attributes.tags:%20%22__internal_immutable:true%22"

real	0m0.554s
user	0m0.032s
sys	0m0.012s

On this PR as of cc06e671adc2f7ed7b8f5bce4f48b218aa56edf5

15 seconds for rules table to load on UI without any rules installed status api call below

$ time ./get_prepackaged_rules_status.sh 
{
  "rules_custom_installed": 0,
  "rules_installed": 0,
  "rules_not_installed": 145,
  "rules_not_updated": 0
}

real	0m4.905s
user	0m0.029s
sys	0m0.010s

31 seconds to install all the prepackaged rules from the UI

status api call below

$ time ./get_prepackaged_rules_status.sh 
{
  "rules_custom_installed": 0,
  "rules_installed": 145,
  "rules_not_installed": 0,
  "rules_not_updated": 0
}

real	0m5.107s
user	0m0.029s
sys	0m0.012s
$
$
$
$
$ # below finds all the prepackaged rules and prints them out
$ time ./find_rule_by_filter.sh "alert.attributes.tags:%20%22__internal_immutable:true%22"

real	0m1.997s
user	0m0.032s
sys	0m0.013s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment