Skip to content

Commit

Permalink
fix cached enforcer mgmt event log (#151)
Browse files Browse the repository at this point in the history
  • Loading branch information
GopherJ authored May 12, 2020
1 parent c74b382 commit d7c9fe6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cached_enforcer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ use crate::{
Result,
};

#[cfg(any(feature = "logging", feature = "watcher"))]
use crate::emitter::notify_logger_and_watcher;

#[cfg(feature = "watcher")]
use crate::watcher::Watcher;

Expand Down Expand Up @@ -83,6 +86,7 @@ impl CoreApi for CachedEnforcer {
};

cached_enforcer.on(Event::ClearCache, clear_cache);
cached_enforcer.on(Event::PolicyChange, notify_logger_and_watcher);

Ok(cached_enforcer)
}
Expand Down

1 comment on commit d7c9fe6

@GopherJ
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust Benchmark

Benchmark suite Current: d7c9fe6 Previous: c74b382 Ratio
b_benchmark_abac_model 7152 ns/iter (± 901) 6778 ns/iter (± 3486) 1.06
b_benchmark_basic_model 7857 ns/iter (± 1274) 7054 ns/iter (± 690) 1.11
b_benchmark_cached_abac_model 406 ns/iter (± 97) 376 ns/iter (± 79) 1.08
b_benchmark_cached_key_match 419 ns/iter (± 71) 387 ns/iter (± 60) 1.08
b_benchmark_cached_priority_model 411 ns/iter (± 69) 378 ns/iter (± 54) 1.09
b_benchmark_cached_rbac_model 419 ns/iter (± 74) 370 ns/iter (± 47) 1.13
b_benchmark_cached_rbac_model_large 443 ns/iter (± 34) 391 ns/iter (± 69) 1.13
b_benchmark_cached_rbac_model_medium 407 ns/iter (± 40) 375 ns/iter (± 33) 1.09
b_benchmark_cached_rbac_model_small 396 ns/iter (± 37) 382 ns/iter (± 81) 1.04
b_benchmark_cached_rbac_model_with_domains 479 ns/iter (± 40) 435 ns/iter (± 53) 1.10
b_benchmark_cached_rbac_with_deny 420 ns/iter (± 111) 372 ns/iter (± 46) 1.13
b_benchmark_cached_rbac_with_resource_roles 418 ns/iter (± 31) 378 ns/iter (± 45) 1.11
b_benchmark_key_match 27912 ns/iter (± 3940) 26899 ns/iter (± 3707) 1.04
b_benchmark_priority_model 9368 ns/iter (± 635) 8548 ns/iter (± 7382) 1.10
b_benchmark_raw 8 ns/iter (± 0) 7 ns/iter (± 0) 1.14
b_benchmark_rbac_model 23476 ns/iter (± 2083) 19624 ns/iter (± 1865) 1.20
b_benchmark_rbac_model_large 64638188 ns/iter (± 4500067) 56662686 ns/iter (± 4800634) 1.14
b_benchmark_rbac_model_medium 6181854 ns/iter (± 372296) 5968089 ns/iter (± 872134) 1.04
b_benchmark_rbac_model_small 603780 ns/iter (± 56609) 576149 ns/iter (± 87329) 1.05
b_benchmark_rbac_model_with_domains 12531 ns/iter (± 1808) 12999 ns/iter (± 2196) 0.96
b_benchmark_rbac_with_deny 38855 ns/iter (± 4372) 36298 ns/iter (± 4712) 1.07
b_benchmark_rbac_with_resource_roles 10557 ns/iter (± 963) 10089 ns/iter (± 3233) 1.05
b_benmark_cached_basic_model 407 ns/iter (± 47) 415 ns/iter (± 41) 0.98

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.