This file contains hidden or 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 pod(uid) | |
pod = {"kind" => "Pod", | |
"apiVersion" => "v1", | |
"metadata" => | |
{"name" => "stress6-1-trz0g", | |
"generateName" => "stress6-1-", | |
"namespace" => "vcr-tests", | |
"selfLink" => "/api/v1/namespaces/vcr-tests/pods/stress6-1-trz0g", | |
"uid" => uid, | |
"resourceVersion" => "1809029", |
This file contains hidden or 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
[#<EmsEvent:0x000000000903d000 | |
id: 3769, | |
event_type: "CONTAINER_KILLING", | |
message: "Killing container with id docker://deployment:Need to kill Pod", | |
timestamp: Mon, 09 Oct 2017 14:15:32 UTC +00:00, | |
host_name: nil, | |
host_id: nil, | |
vm_name: nil, | |
vm_location: nil, | |
vm_or_template_id: nil, |
This file contains hidden or 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
{2017-10-05 11:33:14 UTC=>0.0008883925}, | |
{2017-10-05 11:33:54 UTC=>0.0011175}, | |
{2017-10-05 11:34:14 UTC=>22.935428365}, | |
{2017-10-05 11:34:54 UTC=>84.5403323575}, | |
{2017-10-05 11:35:14 UTC=>88.23617879}, | |
{2017-10-05 11:35:54 UTC=>55.870726725}, | |
{2017-10-05 11:36:14 UTC=>80.4185096625}, | |
{2017-10-05 11:36:54 UTC=>74.556680755}, | |
{2017-10-05 11:37:14 UTC=>91.34505966}, | |
{2017-10-05 11:37:54 UTC=>42.44492202}, |
This file contains hidden or 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
require 'manageiq_performance' | |
def persister_class | |
# ManageIQ::Providers::Kubernetes::Inventory::Persister::ContainerManager | |
ManageIQ::Providers::Openshift::Inventory::Persister::ContainerManagerStream # just having :batch saving | |
end | |
def generate_batches_od_data(ems_name:, total_elements:, batch_size: 1000) | |
ems = ExtManagementSystem.find_by(:name => ems_name) | |
persister = persister_class.new( |
This file contains hidden or 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
classes = [ | |
ManageIQ::Providers::Redhat::InfraManager, | |
EmsFolder, | |
EmsCluster, | |
ResourcePool, | |
Host, | |
Vm, | |
Relationship, | |
Storage, | |
MiqEventDefinition, |
This file contains hidden or 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
#!/usr/bin/env bash | |
# memusg -- Measure memory usage of processes | |
# Usage: memusg COMMAND [ARGS]... | |
# | |
# Author: Jaeho Shin <[email protected]> | |
# Created: 2010-08-16 | |
############################################################################ | |
# Copyright 2010 Jaeho Shin. # | |
# # | |
# Licensed under the Apache License, Version 2.0 (the "License"); # |
This file contains hidden or 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
#!/usr/bin/env bash | |
# memusg -- Measure memory usage of processes | |
# Usage: memusg COMMAND [ARGS]... | |
# | |
# Author: Jaeho Shin <[email protected]> | |
# Created: 2010-08-16 | |
############################################################################ | |
# Copyright 2010 Jaeho Shin. # | |
# # | |
# Licensed under the Apache License, Version 2.0 (the "License"); # |
This file contains hidden or 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
classes = [ | |
Authentication, | |
ComputerSystem, | |
Container, | |
ContainerBuild, | |
ContainerBuildPod, | |
ContainerComponentStatus, | |
ContainerCondition, | |
ContainerEnvVar, | |
ContainerGroup, |
This file contains hidden or 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
ActiveRecord::Base.logger = Logger.new(STDOUT) | |
ems = ManageIQ::Providers::Amazon::CloudManager.create!(:name => "aws_ems_small", #"aws_ems", | |
:hostname => "192.168.231.231", | |
:port => 443, | |
:zone => Zone.first, | |
:provider_region => "us-east-1") | |
# ems.update_authentication(:bearer => {:auth_key => token, :save => true}) |
This file contains hidden or 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
generate_batches_od_data(:ems_name => "my_ems", :total_elements => 1234) | |
def generate_batches_od_data(ems_name:, total_elements:, batch_size: 1000) | |
ems = ExtManagementSystem.find_by(:name => ems_name) | |
persister = ManageIQ::Providers::Amazon::Inventory::Persister::StreamedData.new( | |
ems, ems | |
) | |
count = 1 | |
persister, count = process_entity(ems, :vm, persister, count, total_elements, batch_size) |