Created
June 21, 2017 15:10
-
-
Save kbrock/6b2fef0e99270b2caba1436046bf576c to your computer and use it in GitHub Desktop.
Metrics capture timing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def reload_models | |
[Vm, Host, Storage].each { |m| m.update_all(:last_perf_capture_on => 50.minutes.ago) } # <== still tweaking | |
[MiqTask, MiqQueue, Metric, MetricRollup, VimPerformanceState].each { |m| m.truncate} | |
ActiveRecord::Base.connection.execute("vacuum full") | |
Module.clear_all_cache_with_timeout | |
[[MiqProductFeature, :@feature_cache], [MiqProductFeature, :@obj_cache], [BottleneckEvent, :@event_definitions], | |
[Tenant, :@root_tenant]].each { |i, ivar| i.instance_variable_set(ivar, nil) } | |
MiqServer.my_server ; MiqServer.my_zone | |
[ExtManagementSystem, Host, EmsCluster, Tagging, Tag, HostStorage, Storage, Vm, MiqRegion, MiqTask, Relationship, Disk, | |
Endpoint, Authentication, ServerRole, MiqWorker, MiqQueue, MetricRollup, BottleneckEvent].each { |m| m.first } | |
end | |
# run multiple times: | |
reload! ; reload_models ; bookend("capu-trunc", :gc => true) { Metric::Capture.perf_capture_timer } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment