Code Experience part 2

 document.getElementByID,
 document.getElementByName,

add listener, watch, watch group, emit, broadcast,event listener,
key press events

Apache jmetr, wireframe,


urllib2 is not present in python3

https://stackoverflow.com/questions/58794540/no-module-named-urllib2-how-do-i-use-it-in-python-so-i-can-make-a-request



Create project


Project:Corex-Test-Framework-Lambda


Plan Name: Test-Framework-PRD-Lambda-plan


Plan key: Test-Framework-PRD-Lambda-plan


Plan Description: This configuration plan is currently created only for Deleting old ES Indices


Config job: save , -->create


Deployment Include Patterns: TestFramework-Lambda-Deployment/*





sudo netstat -plnt



Create project


Project:Corex-Test-Framework-Lambda


Plan Name: Test-Framework-PRD-Lambda-plan


Plan key: Test-Framework-PRD-Lambda-plan


Plan Description: This configuration plan is currently created only for Deleting old ES Indices


Config job: save , -->create


Deployment Include Patterns: TestFramework-Lambda-Deployment/*


Amazon S3

ghx-cp-deployment

Cplus-NG/

s3tocorexlambda/

release/

7/

7/



 try {


            URL url = new URL("http://localhost:8080/ui-heimdall/rest/eventbus/listenersbacklog?pageNum=0&pageSize=10&onlyConsumableAfter=false");//your url i.e fetch data from .

            HttpURLConnection conn = (HttpURLConnection) url.openConnection();

            conn.setRequestMethod("GET");

            conn.setRequestProperty("Accept", "*/*");

            conn.setRequestProperty("Content-Type", "application/json");

            conn.setRequestProperty("Username", "spkannan");

            conn.setRequestProperty("Password", "Corex@tfw123");


            conn.setRequestProperty("Authorization", "Basic c3BrYW5uYW46Q29yZXhAdGZ3MTIz");

            if (conn.getResponseCode() != 200) {

                throw new RuntimeException("Failed : HTTP Error code : "

                        + conn.getResponseCode());

            }

            InputStreamReader in = new InputStreamReader(conn.getInputStream());

            BufferedReader br = new BufferedReader(in);

            String output;

            while ((output = br.readLine()) != null) {

                System.out.println(output);

            }

            conn.disconnect();


        } catch (Exception e) {

            System.out.println("Exception in NetClientGet:- " + e);

        }
























{"buildWithStatus":{ "path" : ""},"isFolderExtRequired":"false"}








<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.ghx</groupId>
<artifactId>test-framework</artifactId>
<version>2.3.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<groupId>com.testframework.lambdas</groupId>
<artifactId>test-framework-lambdas</artifactId>
<description>Lambda - To get build number status</description>
<profiles>
<profile>
<activation>
<os>
<family>!windows</family>
</os>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
<forceJavacCompilerUse>true</forceJavacCompilerUse>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.0.0</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<!-- Script to Zip lambda files -->
<phase>generate-sources</phase>
<goals>
<goal>exec</goal>
</goals>
<configuration>
<executable>src/main/resources/create-zipfiles-for-lambda.sh</executable>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>

<dependencies>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>${aws.lambda.java.events}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-core</artifactId>
<version>${aws-lambda-java-core}</version>
</dependency>
<!-- https://mvnrepository.com/artifact/com.amazonaws/aws-java-sdk-rds -->
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-rds</artifactId>
<version>${aws.sdk.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>${apache.commons.io.version}</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20180130</version>
</dependency>
<dependency>
<groupId>com.google.collections</groupId>
<artifactId>google-collections</artifactId>
<version>${google-collections}</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>${com.google.guava}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-java-sdk-lambda</artifactId>
<version>${aws-java-sdk-lambda}</version>
</dependency>
<dependency>
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
<version>${commons-logging}</version>
</dependency>
</dependencies>
</project>


create-zipfiles-for-lambda.sh

#!/usr/bin/env bash
########################################
#
# Zip Folder Creation
#
# Description:
# This Script Creates Zip File of test-framework 
# Lambda files
#
# spkannan : 2020-01-09 : zipping script
#
########################################
zip target/tfw-delete-stacks.zip src/main/resources/tfw-delete-stacks.py

zip target/tfw-es-cluster-lambda.zip src/main/resources/tfw-es-cluster-lambda.py

zip target/tfw-escluster-prd-lambda.zip src/main/resources/tfw-escluster-prd-lambda.py

zip -r target/tfw-s3-temp-folder-deletion.zip src/main/resources/tfw-s3-deletion


In Repository Change detection Include only changes that match ^.*test-framework\/test-framework-lambdas\/.*

exclude changeset version to .* web repository bitbucket server


color card with css

homePageService.tolerance().then (function(response){
$scope.engineTolerance = response;
});
$scope.getColor = function (val, baseVal) {
console.log("tolerance"+parseInt($scope.engineTolerance));
if(val <= baseVal) {
return "green";
} else if ( val > baseVal && val <= baseVal+ parseInt($scope.engineTolerance) ) {
return "amber";
} else if ( val > baseVal+ parseInt($scope.engineTolerance )) {
return "red";
}
//return "red";
};

<md-card flex="25" ng-class="{'color-green' : getColor(val,baseline[$index]) == 'green', 'color-amber' : getColor(val,baseline[$index]) == 'amber', 'color-red' : getColor(val,baseline[$index]) == 'red' }" ng-if="selectedBaselineEngines.indexOf(key) !== -1" ng-repeat="(key, val) in compareBaseline track by $index">


with filter for same coloring in md-card

<md-card flex="25" class="{{val | checkmark:baseline[$index]:engineTolerance}}" ng-if="selectedBaselineEngines.indexOf(key) !== -1" ng-repeat="(key, val) in compareBaseline track by $index">


angular.module('testFramework.homePage').controller('homePageController', homePageController);
angular.module('testFramework.homePage').filter('checkmark', function() {
  return function(percentage, baseline, engineTolerance) {
  if(parseInt(engineTolerance) > 0){
  if(parseInt(percentage) <= parseInt(baseline)) {
return "color-green";
} else if ( (parseInt(percentage) > parseInt(baseline)) && (parseInt(percentage) <= parseInt(baseline) + parseInt(engineTolerance)) ) {
return "color-amber";
} else if (parseInt(percentage) > (parseInt(baseline) + parseInt(engineTolerance))) {
return "color-red";
  }
return "color-green";
  };
});



html:

<tfw-metrics-chart tab-name="tab.tabName"
       test-result="testResult"
       environment="environment"
       mode="'main'"
       is-collate="isCollate">
</tfw-metrics-chart>
</div>

component.js:
(function () {
'use strict';

var injections = [
'$scope',
'homePageService',
'performanceMetricsReportsService',
'performanceMetricsChartsService',
'appToaster',
'$filter',
'localization',
'tfwMetricsChartService',
];

function tfwMetricsChartController($scope, homePageService, performanceMetricsReportsService, performanceMetricsChartsService, appToaster, $filter, localization, tfwMetricsChartService) {
var $ctrl = this;

var chartComponent = {
templateUrl: 'heimdall/testFramework/homePage/components/tfwMetricsChart/tfwMetricsChart.html',
bindings: {
tabName: '=',
testResult: '<',
environment: '=',
mode: '=',
isCollate: '=',
},
controller: tfwMetricsChartController,
};

tfwMetricsChartController.$inject = injections;

angular.module('testFramework.homePage').component('tfwMetricsChart', chartComponent);
})();




Broad Cast:

timeoutPromise = $timeout(function () {
$scope.$broadcast('tabSelected', tabName);
}, 500);


$scope.$on('tabSelected', function() {
var tabName = $ctrl.tabName;

if ($ctrl.testResult) {
if ($scope.graphsTab.indexOf(tabName) !== -1) {
$scope.chartContainerForNewrelic = angular.copy(homePageService.chartContainerForNewrelic);
$scope.environment = $ctrl.environment;
$scope.testResult = $ctrl.testResult;
switch (tabName) {
case 'mySql':
$scope.getMySqlGroupData(tabName);
break;
case 'es':
$scope.getESGroupData(tabName);
break;
case 'mongoDb':
$scope.getMongoDbGroupData(tabName);
break;
case 'dynamoDb':
$scope.getDynamoDbGroupData(tabName);
break;
case 'engineTrends':
$scope.getEngineTrendsGroupData(tabName);
break;
case 'esTrends':
$scope.getESTrendsGroupData(tabName);
break;
case 'dynamoDbTrends':
$scope.getDynamoDbTrendsGroupData(tabName);
break;
case 'mongoDbTrends':
$scope.getMongoDbTrendsGroupData(tabName);
break;
case 'mySqlTrends':
$scope.getMySqlTrendsGroupData(tabName);
break;
default:
$scope.getChartData(tabName);
break;
}
}
}
});

ng-bind-html:

<pre ng-bind-html="testResultJiraTicket.ticketLink | trustAsHtml"></pre>


function updateJiraLink(testResult) {
$scope.loading = true;
homePageService.getConfigsvcValue('jira-default-url').then(function (jiraTicketLink) {
if (jiraTicketLink && testResult.testResultJiraTickets) {
angular.forEach(testResult.testResultJiraTickets, function (jira) {
if (jira.ticket) {
var val = /[\s\n,]/g;
var values = jira.ticket.split(val);
jira.ticketLink = jira.ticket;
angular.forEach(values, function (value) {
if (value && value.includes(jiraTicketLink)) {
var updatedLink = '<a href="' + value + '">' + value + '</a>';
jira.ticketLink = jira.ticketLink.replace(value, updatedLink);
}
});
}
});
}
}).catch(function (error) {
appToaster.pop(error.data.exceptionMessage || localization.get('label.error'));
}).finally(function () {
$scope.loading = false;
});
return testResult;
}


if IP address reached max level then need to delete Network Interface which is in Available state
Since NI with "available" state will have detached from EC2 instance and is unused.


General Fluentd:

#!/usr/bin/env python3.8

import boto3
import botocore
import datetime
import json
import re
import requests
import uuid


def loadConfig(configobj, cfile):
    f = open(cfile, 'r')
    for line in f:
        line = line.strip()
        (param, value) = re.split(':', line, maxsplit=1)
        configobj[param] = value
    f.close()
    return configobj

def set_subdomain(metaobj):
    """set sub domain details"""
    if metaobj['accountId'] == "050190852521":
        subd = 'awsdsi.ghx.com'
    else:
        subd = 'awsprd.ghx.com'
    return subd

def initializeEvents(configobj):
    eventMeta = {}
    meta = json.loads(requests.get('http://169.254.169.254/latest/dynamic/instance-identity/document/').content)
    instanceArn = 'arn:aws:ec2:' + meta['region'] + ':' + meta['accountId'] + ':instance/' + meta['instanceId']
    eventMeta['version'] = '101'
    eventMeta['detailtype'] = 'EC2 Bootstrap'
    eventMeta['source'] = 'ghx.ec2'
    eventMeta['account'] = meta['accountId']
    eventMeta['time'] = ''
    eventMeta['region'] = meta['region']
    eventMeta['ghxenvironment'] = configobj['GHXEnvironment']
    eventMeta['resources'] = [instanceArn]
    eventMeta['ipv4'] = meta['privateIp']
    eventMeta['instanceId'] = meta['instanceId']
    eventMeta['component'] = configobj['service']
    eventMeta['compversion'] = configobj['ApplicationVersion']
    eventMeta['compbuild'] = configobj['BuildNumber']
    eventMeta['activityid'] = str(uuid.uuid4())
    eventMeta['detail'] = {}
    return eventMeta


def publishEvent(configobj, eventMeta, statuscode, statusmessage, description, task, etime, stime, cause):
    if eventing:
        details = {}
        details['StatusCode'] = statuscode
        details['StatusMessage'] = statusmessage
        details['Description'] = description
        details['EC2Action'] = 'fluentconfig'
        details['ActionTask'] = task
        details['EndTime'] = etime
        details['StartTime'] = stime
        details['Cause'] = cause
        details['eventid'] = str(uuid.uuid4())
        eventMeta['detail'] = details
        k = boto3.client('kinesis', region_name=eventMeta['region'])
        partitionkey = eventMeta['instanceId']
        eventMeta['time'] = datetime.datetime.utcnow().isoformat()
        try:
            jsonstr = json.dumps(eventMeta, indent=2)
            response = k.put_record(StreamName=stream, Data=jsonstr, PartitionKey=partitionkey)
        except botocore.exceptions.ClientError as e:
            print(json.dumps(e.response, indent=2))
            print("ERROR:", e.response['Error']['Code'])
            print("      ", e.response['Error']['Message'])
            return False, e.response
        if response['ResponseMetadata']['HTTPStatusCode'] == 200:
            return True
        else:
            return False
    else:
        return False


def downloadAsset(bucket, path, rfile, ddir, lfile):
    s3client = boto3.resource('s3')
    try:
        s3client.meta.client.download_file(bucket, path + rfile, ddir + lfile)
        return True
    except Exception as e:
        print("ERROR: failed to download file", rfile)
        print(e)
        return False


def getTemplate(configobj, metaobj):
    # get fluentd config template to /tmp/fluentd.conf.template
    file = 'fluentd.conf.template'
    if configobj['Application'] == 'test-framework-minion':
        file = 'test-framework-minion-fluentd.conf.template'
    downloadAsset(configobj['DeploymentBucket'], configobj['Product'] + '/'
                  + configobj['ApplicationVersion'] + '/' + configobj['BranchName'] + '/'
                  + configobj['BuildNumber'] + '/cf-deploy/templates/',
                  file, '/tmp/', file)


def buildConf(configobj, metaobj):
    template_path = '/tmp/fluentd.conf.template'
    if configobj['Application'] == 'test-framework-minion':
        template_path = '/tmp/test-framework-minion-fluentd.conf.template'
    tdi = open(template_path, 'r')
    tdo = open('/etc/td-agent/td-agent.conf', 'w')
    for line in tdi:
        line = line.replace('SERVICE', configobj['service'], 1)
        line = line.replace('IPV4', metaobj['privateIp'], 1)
        line = line.replace('INSTANCEID', metaobj['instanceId'], 1)
        line = line.replace('GHXENV', configobj['GHXEnvironment'].lower(), 1)
        line = line.replace('APPVERSION', configobj['ApplicationVersion'], 1)
        line = line.replace('BUILDNUMBER', configobj['BuildNumber'], 1)
        line = line.replace('CFSTACK', configobj.get('CFStackName', 'na'), 1)
        line = line.replace('APPLICATION', configobj['Application'], 1)
        line = line.replace('REGION', metaobj['region'], 1)
        line = line.replace('SUBDOMAIN', set_subdomain(metaobj), 1)
        if configobj['Application'] == "test-framework-minion" and configobj.get('TestResultId', 'na').lower() != 'na':
            line = line.replace('TESTRESULTID', configobj['TestResultId'], 1)
        tdo.write(line)
    tdi.close()
    tdo.close()


def main():
    print("cf-config-fluentd.py : START")
    stime = datetime.datetime.utcnow().isoformat()
    configuration = {}
    global eventing
    eventing = True
    print("cf-config-fluentd.py : initialize eventing and configuration")
    try:
        loadConfig(configuration, '/opt/conf/cf-params.txt')
    except:
        print("cf-config-fluentd.py : failed to load configuration, exiting")
        exit(0)
    metadata = json.loads(requests.get('http://169.254.169.254/latest/dynamic/instance-identity/document/').content)
    global stream
    stream = 'eventflow'

    global eventMeta
    try:
        eventMeta = initializeEvents(configuration)
    except:
        print("cf-config-fluentd.py : failed to initialize events, skipping eventing")
        eventing = False
    try:
        publishEvent(configuration, eventMeta, 'start', '', 'EC2 bootstrap command', '', datetime.datetime.utcnow().isoformat(), stime,
                     'This action is triggered by CFN command definitions')
    except:
        print("cf-config-fluentd.py : failed to publish event")

    # download template file
    print("cf-config-fluentd.py : download template file")
    getTemplate(configuration,metadata)

    # substitutions
    print("cf-config-fluentd.py : perform substitutions")
    buildConf(configuration, metadata)

    print("cf-config-fluentd.py : COMPLETE")
    publishEvent(configuration, eventMeta, 'complete', '', 'EC2 bootstrap command', '', datetime.datetime.utcnow().isoformat(),
                 stime, 'This action is triggered by CFN command definitions')


if __name__ == "__main__":
    main()

TFW FluentD:
<source>
@type tail
path /install/testresults/*/5_output/*.jtl
pos_file /install/testresults/*/5_output/*.jtl.pos
tag testresultsjtl.log
refresh_interval 2s
enable_stat_watcher true
open_on_every_update true
<parse>
@type grok
<grok>
pattern "%{DATA:timeStamp},%{NUMBER:elapsed:integer},%{DATA:label},%{DATA:responseCode},%{DATA:responseMessage},%{DATA:threadName},%{DATA:dataType},%{DATA:success},%{DATA:failureMessage},%{NUMBER:bytes:integer},%{NUMBER:sentBytes:integer},%{NUMBER:grpThreads:integer},%{NUMBER:allThreads:integer},%{NUMBER:Latency:integer},%{NUMBER:IdleTime:integer},%{NUMBER:Connect:integer}"
@timestamp ${Time.at(record['timeStamp'].to_i/1000).strftime('%Y-%m-%dT%H:%M:%S.%LZ')}
</grok>
</parse>
</source>
<filter>
    @type record_transformer
    <record>
        service         "SERVICE"
        ghxhost         "IPV4"
        instanceId      "INSTANCEID"
        ghxenvironment  "GHXENV"
        appversion      "APPVERSION"
        buildnumber     "BUILDNUMBER"
        cfstack         "CFSTACK"
        application     "APPLICATION"
testResultId    "TESTRESULTID"
        type            ${tag}
    </record>
</filter>
<filter testresultsjtl.log>
    @type record_transformer
    enable_ruby
    <record>
    @timestamp ${Time.at(record['timeStamp'].to_i/1000).strftime('%Y-%m-%dT%H:%M:%S.%LZ')}
    </record>
</filter>
<match testresultsjtl.log>
@type copy
<store>
@type elasticsearch
time_key @timestamp
host "REGION-testframework-es.SUBDOMAIN"
port 443
scheme https
index_name GHXENV-minion-jtl-logs-%Y.%m.%d
reload_connections false
ssl_verify false
<buffer tag, time>
    @type memory
    timekey 5 # or 1m and 1h like unit suffix are also supported.
    timekey_wait 5
</buffer>
</store>
</match>


FLuentD config:

<source>
@type tail
@id javalog
path /var/log/tomcat/catalina.out
pos_file /var/log/td-agent/tomcat-catalina.out.pos
tag javalog
read_from_head true
    <parse>
      @type multiline
      format_firstline /\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}/
      format1 /^(?<timestamp>\d{4}-\d{2}-\d{2} \d{2}:\d{2}:\d{2},\d{3}) \|(?<loglevel>[^\s]+) \[(?<threadname>.*)\] (?<logmsg>.*)/
    </parse>
</source>
<source>
@type tail
@id webaccess
path /var/log/tomcat/localhost_access_log.txt
pos_file /var/log/td-agent/tomcat-localhost_access_log.txt.pos
tag webaccess
read_from_head true
<parse>
@type none
</parse>
</source>
<source>
@type tail
@id ossec
path /var/ossec/logs/alerts/alerts.json
pos_file /var/log/td-agent/osseclog-alerts.json.pos
tag ossec
read_from_head true
<parse>
@type json
</parse>
</source>
<filter>
    @type record_transformer
    <record>
        service         "SERVICE"
        ghxhost         "IPV4"
        instanceId      "INSTANCEID"
        ghxenvironment  "GHXENV"
        appversion      "APPVERSION"
        buildnumber     "BUILDNUMBER"
        cfstack         "CFSTACK"
        application     "APPLICATION"
        type            ${tag}
    </record>
</filter>
<filter ossec>
    @type record_transformer
    enable_ruby
    <record>
        short_message   ${record.dig("rule", "comment")}
    </record>
</filter>
<match {javalog,webaccess}>
@type kinesis_streams
region REGION
stream_name applogs
    <buffer>
      flush_at_shutdown true
      flush_mode immediate
      flush_thread_count 8
      flush_thread_interval 1
      flush_thread_burst_interval 1
      retry_forever true
      retry_type exponential_backoff
    </buffer>
</match>
<match ossec>
@type kinesis_streams
region REGION
stream_name seclogs
    <buffer>
        chunk_limit_size 1m
        flush_at_shutdown true
        flush_mode immediate
        flush_thread_count 15
        flush_thread_interval 0.1
        flush_thread_burst_interval 0.01
        retry_forever true
        retry_type exponential_backoff
    </buffer>
</match>

FluentD initiated in minion stack:

 "fluentd": {
                        "commands": {
                            "01-get-fluentd-script": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/cf-config-fluentd.py /opt/scripts/cf-config-fluentd.py",
                                            " ; chmod 744 /opt/scripts/cf-config-fluentd.py"
                                        ]
                                    ]
                                }
                            },
                            "05-config-fluentd": {
                                "command": "/opt/scripts/cf-config-fluentd.py; cd /opt/td-agent/bin; sudo /usr/sbin/td-agent-gem install fluent-plugin-elasticsearch; sudo /usr/sbin/td-agent-gem install fluent-plugin-grok-parser; systemctl enable td-agent.service; systemctl restart td-agent.service"
                            }
                        }
                    },


Minion complete stack:

{
    "AWSTemplateFormatVersion": "2010-09-09",
    "Description": "Test Framework Minion stack",
    "Parameters": {
        "VPCStackName": {
            "Description": "Name of the VPC CloudFormaiton Stack",
            "Type": "String",
            "Default": "LegacyVpcCfOutputs"
        },
        "InstanceType": {
            "Description": "WebServer EC2 instance type",
            "Type": "String",
            "Default": "m5a.large",
            "AllowedValues":[
                "m3.medium",
                "m3.large",
                "m4.large",
                "m4.xlarge",
                "m4.2xlarge",
                "m5a.large",
                "m5a.xlarge",
                "t3a.medium",
                "t3a.small",
                "t2.medium",
                "t2.small"
            ],
            "ConstraintDescription": "must be a valid EC2 instance type."
        },
        "KeyName": {
            "Description": "Name of an existing EC2 KeyPair to enable SSH access to the instance",
            "Type": "AWS::EC2::KeyPair::KeyName",
            "ConstraintDescription": "must be the name of an existing EC2 KeyPair."
        },
        "configSVCurl": {
            "Description": "The URL of the configsvc to use",
            "Type": "String",
            "ConstraintDescription": "must be the name of an existing configsvc mongo database."
        },
        "testFrameWorkURL": {
            "Description": "The URL of the testframework to use",
            "Type": "String",
            "ConstraintDescription": "must be the name of an existing testframework mongo database."
        },
        "configSVCpass": {
            "Description": "The encrypted password of the configsvc to use",
            "Type": "String",
            "ConstraintDescription": "must be the password of an existing configsvc mongo database."
        },
        "AdditionalJavaOpts": {
            "Description": "Additional JAVA_OPTS as system properties, -Dname=value",
            "Type": "String",
            "Default": "",
            "ConstraintDescription": "Set as system property, -D"
        },
        "ScalingMax": {
            "Description": "Max Number to scale EC2 instances to",
            "Type": "Number",
            "Default": "1",
            "MinValue": "1",
            "MaxValue": "350"
        },
        "ScalingMin": {
            "Description": "Min Number to scale EC2 instances to",
            "Type": "Number",
            "Default": "1",
            "MinValue": "1",
            "MaxValue": "200"
        },
        "MongoConfigDB":{
            "Description":"Connection String to the Mongo Shard Config database. Only used if MongosEnabled=true",
            "Type":"String",
            "Default":"UNKNOWN",
            "ConstraintDescription":"must be a valid mongodb url"
        },
        "MongosEnabled":{
            "Description":"Select true to enable Mongos to allow AppServer to connect to a shard",
            "Type":"String",
            "Default":"false",
            "AllowedValues":[
                "true",
                "false"
            ],
            "ConstraintDescription":"must be true or false"
        },
        "Service" : {
            "Description" : "Value to apply to the service tag for instances",
            "Type": "String",
            "Default": "test-framework-minion"
        },
        "InstanceMonitoring" : {
            "Description" : "Set to false for Basic monitoring and true for Detailed monitoring",
            "Type": "String",
            "Default": "false"
        },
        "Application":{
            "Description":"Application   To Map To Application ",
            "Type":"String",
            "ConstraintDescription":"Must Be Valid Application Label"
        },
        "War": {
            "Description": "The War Name",
            "Type": "String",
            "ConstraintDescription": "Name of the war to deployed"
        },
        "DeploymentBucket" : {
            "Description" : "Set to true to create SNS notifications for instance_terminations of ASGs",
            "Type" : "String",
            "Default" : "ghx-deployment"
        },
        "GHXEnvironment": {
            "Description": "GHX environment",
            "Type": "String",
            "AllowedValues": [
                "CUSTOM",
                "DEV",
                "STG",
                "DEVINT",
                "CoreXBINT",
                "PRD",
                "LOAD"
            ]

        },
        "TagName": {
            "Description": "Name of EC2 instances launched from AutoScalingGroup",
            "Type": "String"
        },
        "ApplicationVersion": {
            "Description": "Application Version Number To Map To Application Key In S3",
            "Type": "String",
            "ConstraintDescription": "Must Be Valid Application Version Label"
        },
        "BranchName": {
            "Description": "Bamboo Branch Name",
            "Type": "String",
            "ConstraintDescription": "Must be valid branch name"
        },
        "BuildNumber": {
            "Description": "Bamboo build number",
            "Type": "String",
            "ConstraintDescription": "must be a valid bamboo build number"
        },
        "TestResultId":{
            "Description":"The Id of scenario in case if stack creates by testframework",
            "Type":"String",
            "Default":"NA"
        },
        "Product":{
            "Description":"Product name. Used to determine asset locations in deployment bucket",
            "Type":"String",
            "Default": "corex"
        },
        "NewrelicApiUrl":{
            "Description":"URL of Newrelic API",
            "Type":"String",
            "Default":"NA"
        },
        "NewrelicApiInsightUrlUsCore":{
            "Description":"Url of GHX_US_CORE Newrelic Api Insight",
            "Type":"String",
            "Default":"NA"
        },
        "NewrelicApiInsightUrlNonProduction":{
            "Description":"Url of GHX_NON-PRODUCTION_ENVIRONMENT Newrelic Api Insight",
            "Type":"String",
            "Default":"NA"
        },
        "NewrelicQueryKeyUsCore":{
            "Description":"Query Key of GHX_US_CORE Newrelic",
            "Type":"String",
            "Default":"NA"
        },
        "NewrelicQueryKeyNonProduction":{
            "Description":"Query Key of GHX_NON-PRODUCTION_ENVIRONMENT Newrelic",
            "Type":"String",
            "Default":"NA"
        },
        "NewrelicApiKey":{
            "Description":"API Key of Newrelic",
            "Type":"String",
            "Default":"NA"
        },
    "CloudMongoApiUrl":{
        "Description":"Url of Cloud Mongo Api",
            "Type":"String",
            "Default":"NA"
        },
    "CloudMongoMMSpublickey":{
        "NoEcho" : "true",
         "Description":"Cloud Mongo MMS public key",
            "Type":"String",
            "Default":"NA"
    },
    "CloudMongoMMSprivatekey":{
        "NoEcho" : "true",
         "Description":"Cloud Mongo MMS private key",
            "Type":"String",
            "Default":"NA"
    },
    "ebExecutionURL":{
        "NoEcho" : "true",
         "Description":"eb-execution DB mongo url",
            "Type":"String",
            "Default":"NA"
    },

    "eventbusUrl":{
        "NoEcho" : "true",
         "Description":"Url of mongo DB Event Bus",
        "Type":"String",
            "Default":"NA"
    },
    "AvgCPUUtilization":{
        "Description":"Enable or Disable Average CPU Utilization",
        "Type":"String",
        "Default":"true"
    },
    "MaxCPUUtilization":{
        "Description":"Enable or Disable Maximum CPU Utilization",
        "Type":"String",
        "Default":"true"
    },
    "JvmHeapStats":{
        "Description":"Enable or Disable Jvm Heap Stats",
        "Type":"String",
        "Default":"true"
    },
    "AvgHikariConnections":{
        "Description":"Enable or Disable Average Hikari Connections",
        "Type":"String",
        "Default":"true"
    },
    "MaxHikariConnections":{
        "Description":"Enable or Disable Maximum Hikari Connections",
        "Type":"String",
        "Default":"true"
    },
    "EventBusScanAndOrder":{
        "Description":"Enable or Disable EventBus Scan And Order",
        "Type":"String",
        "Default":"true"
    },
    "EventBusOpcounters":{
        "Description":"Enable or Disable EventBus Opcounters",
        "Type":"String",
        "Default":"true"
    },
    "AvgTPMDBConnections":{
        "Description":"Enable or Disable Average TPM DB Connections",
        "Type":"String",
        "Default":"true"
    },
    "MaxTPMDBConnections":{
        "Description":"Enable or Disable Maximum TPM DB Connections",
        "Type":"String",
        "Default":"true"
    },
    "DynamoDBMetrics":{
        "Description":"Enable or Disable Dynamo DB Metrics",
        "Type":"String",
        "Default":"true"
    },
    "MaxDynamoDBMetrics":{
        "Description":"Enable or Disable Maximum Dynamo DB Metrics",
        "Type":"String",
        "Default":"true"
    },
    "EventBusPublished":{
        "Description":"Enable or Disable EventBus Published (Hour/Second)",
        "Type":"String",
        "Default":"true"
    },
    "EventBusSummaryMetrics":{
        "Description":"Enable or Disable EventBus Summary Metrics",
        "Type":"String",
        "Default":"true"
    },
    "ListenersDelay":{
        "Description":"Enable or Disable Listeners Delay",
        "Type":"String",
        "Default":"true"
    }
    },
    "Conditions" : {
        "IsNotATestStack" : {"Fn::Equals" : [{"Ref":"TestResultId"}, "NA"]}
    },
    "Mappings": {
        "AWSRegionArch2AMI": {
           "us-east-1": {
                "AMIID": "TOKENMINIONAMIUSEAST1"
            },
            "us-west-2": {
                "AMIID": "TOKENMINIONAMIUSWEST2"
            }

        },
        "Ec2Role": {
            "CUSTOM": {
                "Role": "arn:aws:iam::050190852521:instance-profile/DevOpsRole-test-framework"
            },
            "DEV": {
                "Role": "arn:aws:iam::050190852521:instance-profile/DevOpsRole-test-framework"
            },
            "STG": {
                "Role": "arn:aws:iam::050190852521:instance-profile/DevOpsRole-test-framework"
            },
            "DEVINT": {
                "Role": "arn:aws:iam::050190852521:instance-profile/DevOpsRole-test-framework"
            },
            "CoreXBINT": {
                "Role": "arn:aws:iam::050190852521:instance-profile/DevOpsRole-test-framework"
            },
            "PRD": {
                "Role": "arn:aws:iam::326626545197:instance-profile/DevOpsRole-test-framework"
            },
            "LOAD": {
                "Role": "arn:aws:iam::050190852521:instance-profile/DevOpsRole-test-framework"
            }
        }
    },
    "Resources": {
        "NetworkInfo": {
            "Type": "Custom::NetworkInfo",
            "Properties": {
                "ServiceToken": {
                    "Fn::Join": ["", [
                        "arn:aws:lambda:", {
                            "Ref": "AWS::Region"
                        }, ":", {
                            "Ref": "AWS::AccountId"
                        },
                        ":function:DescribeCFStackOutputs"
                    ]]
                },
                "StackName": {
                    "Ref": "VPCStackName"
                }
            }
        },
        "MercuryMinionInstanceSecurityGroup": {
            "Type": "AWS::EC2::SecurityGroup",
            "Properties": {
                "GroupDescription": "Security Group for Minion Stack EC2 Instances",
                "SecurityGroupEgress": [{
                        "CidrIp": "0.0.0.0/0",
                        "FromPort": "0",
                        "IpProtocol": "tcp",
                        "ToPort": "65535"
                    }, {
                        "CidrIp": "0.0.0.0/0",
                        "FromPort": "0",
                        "IpProtocol": "udp",
                        "ToPort": "65535"
                    }, {
                        "CidrIp": "0.0.0.0/0",
                        "FromPort": "0",
                        "IpProtocol": "-1",
                        "ToPort": "65535"
                    }

                ],
                "SecurityGroupIngress": [{
                        "CidrIp": "0.0.0.0/0",
                        "FromPort": "0",
                        "IpProtocol": "-1",
                        "ToPort": "65535"
                    }

                ],
                "VpcId": {
                    "Fn::GetAtt": [
                        "NetworkInfo",
                        "VpcId"
                    ]
                }

            }

        },
        "MercuryMinionLaunchConfig": {
            "Type": "AWS::AutoScaling::LaunchConfiguration",
            "Metadata": {
                "AWS::CloudFormation::Init": {
                    "configSets": {
                        "setupall": [
                            "paramfile",
                            "fluentd",
                            "cpumetriccollection",
                            "tpmmetriccollection",
                            "hikarimetriccollection",
                            "heapmetriccollection",
                            "dynamometriccollection",
                            "eventbusmongometriccollection",
                            "cloudmongocollection",
                            "eventbustroubleshooting",
                            "mongos",
                            "deploy"
                        ]

                    },
                    "paramfile": {
                        "files": {
                            "/opt/conf/cf-params.txt": {
                                "content": {
                                    "Fn::Join": ["", [
                                        "accountid:", { 
                                            "Ref": "AWS::AccountId"
                                        }, "\n",
                                        "AdditionalJavaOpts:", {
                                            "Ref": "AdditionalJavaOpts"
                                        }, "\n",
                                        "ApplicationVersion:", {
                                            "Ref": "ApplicationVersion"
                                        }, "\n",
                                        "BranchName:", {
                                            "Ref": "BranchName"
                                        }, "\n",
                                        "BuildNumber:", {
                                            "Ref": "BuildNumber"
                                        }, "\n",
                                        "CFStackName:", {
                                            "Ref": "AWS::StackName"
                                        }, "\n",
                                        "service:",{ 
                                            "Ref" : "Service" 
                                        },"\n",
                                        "MongoConfigDB:",{
                                            "Ref": "MongoConfigDB"
                                        }, "\n",
                                        "MongosEnabled:",{
                                            "Ref": "MongosEnabled" 
                                        }, "\n",
                                        "Application:",{ 
                                            "Ref" : "Application" 
                                        },"\n",
                                        "GHXEnvironment:", {
                                            "Ref": "GHXEnvironment"
                                        }, "\n",
                                        "InstanceType:", {
                                            "Ref": "InstanceType"
                                        }, "\n",
                                        "KeyName:", {
                                            "Ref": "KeyName"
                                        }, "\n",
                                        "region:", {
                                            "Ref": "AWS::Region"
                                        }, "\n",
                                        "ScalingMax:", {
                                            "Ref": "ScalingMax"
                                        }, "\n",
                                        "ScalingMin:", {
                                            "Ref": "ScalingMin"
                                        }, "\n",
                                        "War:", {
                                            "Ref": "War"
                                        }, "\n",
                                        "DeploymentBucket:", {
                                            "Ref": "DeploymentBucket"
                                        }, "\n",
                                        "Product:", { 
                                            "Ref": "Product" 
                                        }, "\n",
                                        "TestResultId:", { 
                                            "Ref": "TestResultId" 
                                        }, "\n",
                                        "NewrelicApiUrl:", { 
                                            "Ref": "NewrelicApiUrl" 
                                        }, "\n",
                                        "NewrelicApiInsightUrlUsCore:", { 
                                            "Ref": "NewrelicApiInsightUrlUsCore" 
                                        }, "\n",
                                        "NewrelicApiInsightUrlNonProduction:", { 
                                            "Ref": "NewrelicApiInsightUrlNonProduction" 
                                        }, "\n",
                                        "NewrelicQueryKeyUsCore:", { 
                                            "Ref": "NewrelicQueryKeyUsCore" 
                                        }, "\n",
"NewrelicQueryKeyNonProduction:", { 
                                            "Ref": "NewrelicQueryKeyNonProduction" 
                                        }, "\n",
                                        "NewrelicApiKey:", { 
                                            "Ref": "NewrelicApiKey" 
                                        }, "\n",
                                        "CloudMongoApiUrl:", { 
                                            "Ref": "CloudMongoApiUrl" 
                                        }, "\n",
                                        "CloudMongoMMSpublickey:", {
                                            "Ref": "CloudMongoMMSpublickey"
                                        }, "\n",
                                        "CloudMongoMMSprivatekey:", {
                                            "Ref": "CloudMongoMMSprivatekey"
                                        }, "\n",
                                        "ebExecutionURL:", {
                                            "Ref": "ebExecutionURL"
                                        }, "\n",
                                        "testFrameWorkURL:", {
                                            "Ref":"testFrameWorkURL"                                    
                                        }, "\n",    
                                        "eventbusUrl:", {
                                            "Ref":"eventbusUrl"
                                        }, "\n",
                                        "AvgCPUUtilization:", {
                                            "Ref":"AvgCPUUtilization"
                                        }, "\n",
                                        "MaxCPUUtilization:", {
                                            "Ref":"MaxCPUUtilization"
                                        }, "\n",
                                        "JvmHeapStats:", {
                                            "Ref":"JvmHeapStats"
                                        }, "\n",
                                        "AvgHikariConnections:", {
                                            "Ref":"AvgHikariConnections"
                                        }, "\n",
                                        "MaxHikariConnections:", {
                                            "Ref":"MaxHikariConnections"
                                        }, "\n",
                                        "EventBusScanAndOrder:", {
                                            "Ref":"EventBusScanAndOrder"
                                        }, "\n",
                                        "EventBusOpcounters:", {
                                            "Ref":"EventBusOpcounters"
                                        }, "\n",
                                        "AvgTPMDBConnections:", {
                                            "Ref":"AvgTPMDBConnections"
                                        }, "\n",
                                        "MaxTPMDBConnections:", {
                                            "Ref":"MaxTPMDBConnections"
                                        }, "\n",
                                        "DynamoDBMetrics:", {
                                            "Ref":"DynamoDBMetrics"
                                        }, "\n",
                                        "MaxDynamoDBMetrics:", {
                                            "Ref":"MaxDynamoDBMetrics"
                                        }, "\n",
                                        "EventBusPublished:", {
                                            "Ref":"EventBusPublished"
                                        }, "\n",
                                        "EventBusSummaryMetrics:", {
                                            "Ref":"EventBusSummaryMetrics"
                                        }, "\n",
                                        "ListenersDelay:", {
                                            "Ref":"ListenersDelay"
                                        }, "\n"
                                    ]]
                                },
                                "mode": "000644",
                                "owner": "root",
                                "group": "root"
                            }
                    },
                    
                        "commands": {
                            "01-createdirs": {
                                "command": "/bin/mkdir /opt/scripts; /bin/mkdir -p /opt/conf/; /bin/mkdir -p /var/log/cpumetric/; /bin/mkdir -p /var/log/hikarimetric/; /bin/mkdir -p /var/log/heapmetric/;"
                            },
                            "02-install-python-es":{
                             "command":"rm -rf /usr/local/lib/python3.8/site-packages/elasticsearch;/usr/bin/pip3.8 install 'elasticsearch==7.13.4';"
                             }
                        }
                    },
                    "fluentd": {
                        "commands": {
                            "01-get-fluentd-script": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/cf-config-fluentd.py /opt/scripts/cf-config-fluentd.py",
                                            " ; chmod 744 /opt/scripts/cf-config-fluentd.py"
                                        ]
                                    ]
                                }
                            },
                            "05-config-fluentd": {
                                "command": "/opt/scripts/cf-config-fluentd.py; cd /opt/td-agent/bin; sudo /usr/sbin/td-agent-gem install fluent-plugin-elasticsearch; sudo /usr/sbin/td-agent-gem install fluent-plugin-grok-parser; systemctl enable td-agent.service; systemctl restart td-agent.service"
                            }
                        }
                    },
                    "cpumetriccollection": {
                        "commands": {   
             "01-get-testfwmetrics-cpu-script": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/cf-start-cpumetriccollection.py /opt/scripts/cf-start-cpumetriccollection.py",
                                            " ; chmod 744 /opt/scripts/cf-start-cpumetriccollection.py"
                                        ]
                                    ]
                                }
                            },
                "02-get-testfwmetrics-newrelic-cpu-script": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                    [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/cf-start-newrelic-cpumetriccollection.py /opt/scripts/cf-start-newrelic-cpumetriccollection.py",
                                            " ; chmod 744 /opt/scripts/cf-start-newrelic-cpumetriccollection.py"
                                        ]
                                    ]
                                }
                            },
                            "11-get-start-cpu": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/start-cpu.sh /opt/scripts/start-cpu.sh",
                                            " ; chmod 744 /opt/scripts/start-cpu.sh"
                                        ]
                                    ]
                                }
                            },
                            "12-get-crontab": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/crontab /tmp/crontab",
                                            " ; cat /tmp/crontab >> /etc/crontab"
                                        ]
                                    ]
                                }
                            },
                            "15-start-cpu": {
                                "command": "/opt/scripts/start-cpu.sh"
                            }
                        }
                    },
                    "tpmmetriccollection": {
                        "commands": {   
                            "01-get-testfwmetrics-newrelic-tpm-script": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                    [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/cf-start-newrelic-tpmmetriccollection.py /opt/scripts/cf-start-newrelic-tpmmetriccollection.py",
                                            " ; chmod 744 /opt/scripts/cf-start-newrelic-tpmmetriccollection.py"
                                        ]
                                    ]
                                }
                            },
                            "02-get-start-tpm": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/start-tpm.sh /opt/scripts/start-tpm.sh",
                                            " ; chmod 744 /opt/scripts/start-tpm.sh"
                                        ]
                                    ]
                                }
                            },
                            "03-start-tpm": {
                                "command": "/opt/scripts/start-tpm.sh"
                            }
                        }
                    },
                    "hikarimetriccollection": {
                        "commands": {   
                            "01-get-testfwmetrics-newrelic-hikari-script": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                    [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/cf-start-newrelic-hikarimetriccollection.py /opt/scripts/cf-start-newrelic-hikarimetriccollection.py",
                                            " ; chmod 744 /opt/scripts/cf-start-newrelic-hikarimetriccollection.py"
                                        ]
                                    ]
                                }
                            },
                            "02-get-start-hikari": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/start-hikari.sh /opt/scripts/start-hikari.sh",
                                            " ; chmod 744 /opt/scripts/start-hikari.sh"
                                        ]
                                    ]
                                }
                            },
                            "03-start-hikari": {
                                "command": "/opt/scripts/start-hikari.sh"
                            }
                        }
                    },
                    "heapmetriccollection": {
                        "commands": {   
                    "01-get-testfwmetrics-newrelic-heap-script": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                    [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/cf-start-newrelic-heapmetriccollection.py /opt/scripts/cf-start-newrelic-heapmetriccollection.py",
                                            " ; chmod 744 /opt/scripts/cf-start-newrelic-heapmetriccollection.py"
                                        ]
                                    ]
                                }
                            },
                            "02-get-start-heap": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/start-heap.sh /opt/scripts/start-heap.sh",
                                            " ; chmod 744 /opt/scripts/start-heap.sh"
                                        ]
                                    ]
                                }
                            },
                            "03-start-heap": {
                                "command": "/opt/scripts/start-heap.sh"
                        }
                      }
                       },
                       "cloudmongocollection":{
                        "commands":{
                               "01-get-testfwmetrics-cloudmongo-script":{
                                "command":{
                                    "Fn::Join":[
                                          "",
                                          [
                                          "aws s3 cp s3://ghx-deployment/corex/",
                                           {"Ref":"ApplicationVersion"},"/",
                                           {"Ref":"BranchName"},"/",
                                           {"Ref":"BuildNumber"},
                                           "/cf-deploy/scripts/cf-start-cloudmongo-eventbuscollection.py /opt/scripts/cf-start-cloudmongo-eventbuscollection.py",
                                           " ; chmod 744 /opt/scripts/cf-start-cloudmongo-eventbuscollection.py"
                                          ]
                                     ]
                                 }
                             },
                             "02-get-start-cloudmongo":{
                             "command":{
                                   "Fn::Join":[
                                       "",
                                       [
                                           "aws s3 cp s3://ghx-deployment/corex/",
                                         {"Ref":"ApplicationVersion"},"/",
                                         {"Ref":"BranchName"},"/",
                                         {"Ref":"BuildNumber"},
                                          "/cf-deploy/scripts/start-cloudmongo.sh /opt/scripts/start-cloudmongo.sh",
                                          " ; chmod 744 /opt/scripts/start-cloudmongo.sh"
                                         ]
                                   ]
                                 }
                              },
                               "03-start-cloudmongo":{
                              "command":"/opt/scripts/start-cloudmongo.sh"
                               }
                         }
                       },
            "dynamometriccollection": {
                         "commands": {   
             "01-get-testfwmetrics-dynamodb-script": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/cf-start-aws-dynamometric-collection.py /opt/scripts/cf-start-aws-dynamometric-collection.py",
                                            " ; chmod 744 /opt/scripts/cf-start-aws-dynamometric-collection.py"
                                        ]
                                    ]
                                }
                           },
               "02-get-start-dynamodb": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/start-dynamo.sh /opt/scripts/start-dynamo.sh",
                                            " ; chmod 744 /opt/scripts/start-dynamo.sh"
                                        ]
                                    ]
                                }
                            },
                "03-start-dynamodb": {
                                "command": "/opt/scripts/start-dynamo.sh"
                                }
                }
                        },
               "eventbustroubleshooting": {
                             "commands": {   
                 "01-get-eventbus-troubleshooting-script": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/cf-start-eventbus-troubleshootingmetrics.py /opt/scripts/cf-start-eventbus-troubleshootingmetrics.py",
                                            " ; chmod 744 /opt/scripts/cf-start-eventbus-troubleshootingmetrics.py"
                                        ]
                                    ]
                                }
                           },
               "02-get-start-eventbus-troubleshooting": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://ghx-deployment/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/start-eventbustroubleshooting.sh /opt/scripts/start-eventbustroubleshooting.sh",
                                            " ; chmod 744 /opt/scripts/start-eventbustroubleshooting.sh"
                                        ]
                                    ]
                                }
                            },
                "03-start-eventbus-troubleshooting": {
                                "command": "/opt/scripts/start-eventbustroubleshooting.sh"
                                }
                }
                        },
             "eventbusmongometriccollection": {
                             "commands": {   
                 "01-get-testfwmetrics-eventbus-script": {
                                  "command": {
                                        "Fn::Join": [
                                          "",
                                          [
                                             "aws s3 cp s3://ghx-deployment/corex/",
                                             { "Ref": "ApplicationVersion" },"/",
                                             { "Ref": "BranchName" },"/",
                                             { "Ref": "BuildNumber" },
                                             "/cf-deploy/scripts/cf-start-mongo-eventbusmetric-collection.py /opt/scripts/cf-start-mongo-eventbusmetric-collection.py",
                                             " ; chmod 744 /opt/scripts/cf-start-mongo-eventbusmetric-collection.py"
                                          ]
                                        ]
                                   }
                              },
                  "02-get-start-eventbusmongo": {
                                   "command": {
                                        "Fn::Join": [
                                           "",
                                           [
                                                "aws s3 cp s3://ghx-deployment/corex/",
                                                { "Ref": "ApplicationVersion" },"/",
                                                { "Ref": "BranchName" },"/",
                                                { "Ref": "BuildNumber" },
                                                "/cf-deploy/scripts/start-eventbus.sh /opt/scripts/start-eventbus.sh",
                                                " ; chmod 744 /opt/scripts/start-eventbus.sh"
                                           ]
                                         ]
                                    }
                               },
                   "03-start-eventbus": {
                                    "command": "/opt/scripts/start-eventbus.sh"
                    }
                   }
                    },
                    "mongos": {
                        "commands": {
                            "01-get-mongos-script": {
                                "command": {
                                    "Fn::Join": [
                                        "",
                                        [
                                            "aws s3 cp s3://",
                                            { "Ref": "DeploymentBucket" },
                                            "/corex/",
                                            { "Ref": "ApplicationVersion" },"/",
                                            { "Ref": "BranchName" },"/",
                                            { "Ref": "BuildNumber" },
                                            "/cf-deploy/scripts/cf-config-mongos.py /opt/scripts/cf-config-mongos.py",
                                            " ; chmod 744 /opt/scripts/cf-config-mongos.py"
                                        ]
                                    ]
                                }
                            },
                            "05-config-mongos": {
                                "command": "/opt/scripts/cf-config-mongos.py"
                            }
                        }
                    },
                    "deploy": {
                        "files": {
                            "/etc/cfn/cfn-hup.conf": {
                                "content": {
                                    "Fn::Join": [
                                        "", [
                                            "[main]\n",
                                            "stack=", {
                                                "Ref": "AWS::StackId"
                                            },
                                            "\n",
                                            "region=", {
                                                "Ref": "AWS::Region"
                                            },
                                            "\n",
                                            "interval=1\n"
                                        ]

                                    ]

                                }

                            },
                            "/opt/scripts/MonitoringDependentAppStatus.sh": {
                                "content": {
                                    "Fn::Join": [
                                          "", [
                                          "#!/usr/bin/env bash",
                                          "\n",
                                         "fluentd=0;\n",
                                           "host=$(hostname -I | awk '{print $1}')",
                                           "\n",
                                          "fluentd=$(ps -ef |grep fluentd |wc -l)",
                                          "\n",
                                        "while [ $fluentd -lt 2 ]",
                                        "\n",
                                        "do",
                                        "\n",
                                        "fluentd=$(ps -ef |grep fluentd |wc -l)",
                                        "\n",
                                        "sleep 2",
                                        "\n",
                                        "done",
                                        "\n",
                                          "if [ $fluentd -gt 1 ]",
                                          "\n",
                                          "then",
                                          "\n",
                                          "dbconnection=`ps -ef |grep tomcat | grep -Po 'test-framework.db.url=\\K(.*)' | cut -d' ' -f1`",
                                          "\n",
                                         "CMD=\"printjson(db.MonitoringDependentAppStatus.remove({'scenarioType':'CUSTOM','minionIP':'$host','applicationName':'fluentd'}),db.MonitoringDependentAppStatus.insert({'scenarioType':'CUSTOM','minionIP':'$host','applicationName':'fluentd','created':{'by':'system','on':ISODate()}}))\"",
                                          "\n",
                                          " /usr/bin/mongo $dbconnection --eval  $CMD",
                                          "\n",
                                          "fi",
                                          "\n"
                                              ]
                                    ]
                                },
                                  "mode": "000777",
                                  "owner": "root",
                                  "group": "root"
                                },
                            "/var/tmp/deployScript/prep.sh": {
                                "content": {
                                    "Fn::Join": [
                                        "", [
                                            "#!/bin/bash",
                                            "\n",
                                            "date > /home/ec2-user/starttime\n",
                                            "ipaddress=`curl http://169.254.169.254/latest/meta-data/local-ipv4`",
                                            "\n",
                                            "hostname=`/bin/hostname`",
                                            "\n",
                                            "echo \"$ipaddress  $hostname\" >> /etc/hosts",
                                            "\n",
                                            "sed -E 's/connectionTimeout=\"[[:digit:]]+\"/connectionTimeout=\"285000\"/g' /etc/tomcat/server.xml > /etc/tomcat/server.xml.improved",
                                            "\n",
                                            "mv -f /etc/tomcat/server.xml.improved /etc/tomcat/server.xml",
                                            "\n",
                                            "cat /etc/tomcat/server.xml",
                                            "\n",
                                            "export environment='", {
                                                "Ref": "GHXEnvironment"
                                            },
                                            "'\n",
                                            "export region='", {
                                                "Ref": "AWS::Region"
                                            },
                                            "'\n",
                                            "export ADDOPTS='", {
                                                "Ref": "AdditionalJavaOpts"
                                            },
                                            "'\n",
                                            "if [ -e /etc/tomcat/tomcat.blank ]; then",
                                            "\n",
                                            "   mv /etc/tomcat/tomcat.blank /etc/tomcat/tomcat.conf",
                                            "\n",
                                            "fi",
                                            "\n",
                                            "echo \"JAVA_OPTS='-Dlogger.level.egx=DEBUG -Dghx.configsvc.db.url=", {
                                                "Ref": "configSVCurl"
                                            },
                                            " -Dghx.test-framework.db.url=", {
                                                "Ref": "testFrameWorkURL"
                                            },
                                            " -Dghx.configsvc.db.pass=", {
                                                "Ref": "configSVCpass"
                                            },
                                            " $ADDOPTS ",
                                            "' \" >> /etc/tomcat/tomcat.conf\n",
                                            "echo \"JMETER_HOME=/install/apache-jmeter-3.2 \" >> /etc/tomcat/tomcat.conf\n",
                                            "\n",
                                            "echo 'export SHUTDOWN_WAIT=300' >> /etc/tomcat/tomcat.conf",
                                            "\n",
                                            "sudo service tomcat start",
                                            "\n",
                                            "sleep 30s",
                                            "\n",
                                            "sh /opt/scripts/MonitoringDependentAppStatus.sh",
                                            "\n"
                                        ]

                                    ]

                                },
                                "mode": "000777",
                                "owner": "root",
                                "group": "root"
                            }
                        },
                        "commands": {
                            "1-deploy-application": {
                                "command": "/var/tmp/deployScript/prep.sh"
                            }

                        }

                    }

                }

            },
            "Properties": {
                "IamInstanceProfile": {
                    "Fn::FindInMap": [
                        "Ec2Role", {
                            "Ref": "GHXEnvironment"
                        },
                        "Role"
                    ]

                },
                "ImageId": {
                    "Fn::FindInMap": [ "AWSRegionArch2AMI", { "Ref": "AWS::Region" }, "AMIID" ]
                },
                "SecurityGroups": [{
                        "Ref": "MercuryMinionInstanceSecurityGroup"
                    }
                ],
                "InstanceType": {
                    "Ref": "InstanceType"
                },
                "KeyName": {
                    "Ref": "KeyName"
                },
                "InstanceMonitoring": {
                    "Ref": "InstanceMonitoring"
                },
                "UserData": {
                    "Fn::Base64": {
                        "Fn::Join": [
                            "", [
                                "#!/bin/bash",
                                "\n",
                                "yum update -y aws-cfn-bootstrap",
                                "\n",
                                "stackID='", {
                                    "Ref": "AWS::StackId"
                                },
                                "'\n",
                                "echo 'RUN CFN-INIT NEXT'",
                                "\n",
                                "/opt/aws/bin/cfn-init -v -c setupall -s $stackID -r MercuryMinionLaunchConfig --region ", {
                                    "Ref": "AWS::Region"
                                },
                                "\n",
                                "echo 'CFN-INIT SHOULD HAVE JUST RUN'",
                                "\n"
                            ]

                        ]

                    }

                }

            }

        },
        "MercuryMinionAutoScaling": {
            "Type": "AWS::AutoScaling::AutoScalingGroup",
            "Properties": {
                "AvailabilityZones": [{
                    "Fn::GetAtt": [
                        "NetworkInfo",
                        "AZ1"
                    ]
                }, {
                    "Fn::GetAtt": [
                        "NetworkInfo",
                        "AZ2"
                    ]
                }],
                "MinSize": {
                    "Ref": "ScalingMin"
                },
                "MaxSize": {
                    "Ref": "ScalingMax"
                },
                "LaunchConfigurationName": {
                    "Ref": "MercuryMinionLaunchConfig"
                },
                "VPCZoneIdentifier": [{
                    "Fn::GetAtt": [
                        "NetworkInfo",
                        "PrivateSubnet1"
                    ]
                }, {
                    "Fn::GetAtt": [
                        "NetworkInfo",
                        "PrivateSubnet2"
                    ]
                }],
                "Tags": [{
                        "Key": "uptimehours",
                        "Value": "24",
                        "PropagateAtLaunch": "true"
                    }, {
                        "Key": "service",
                        "Value": "corex-test-framework",
                        "PropagateAtLaunch": "true"
                    }, {
                        "Key": "owner",
                        "Value": "enhancedeliveryteam@ghx.com",
                        "PropagateAtLaunch": "true"
                    }, {
                        "Key": "Name",
                        "Value": {
                            "Ref": "TagName"
                        },
                        "PropagateAtLaunch": "true"
                    }

                ]

            }

        }

    }


}


Include html inside html:
WE cant bind variable or object if we use html include

<ng-include src="'heimdall/testFramework/mercuryDashboard/currentTestRun/otherDocFlows.html'"></ng-include>

otherDocFlows.html
<dt>
{{::'testframework.otherDocFlows' | l10n}}
<i ng-if="otherLoad.currentTest.isNoOfLoadTest"
   ng-click="refreshOtherInboundFiles(activeTest, testRunTypes[0])"
   class="fa fa-refresh"
   aria-hidden="true"></i>
</dt>
<dd>
<a class="table-cell-test-run-name"
   ng-click="navigateToflowDocNotStartsWith(activeTest)">
<span>{{otherLoad.currentTest.isNoOfLoadTest ? otherLoad.currentTest.noOfOtherLoadTestCount : activeTest.parallelCount}}</span>
</a>
</dd>


Node js code to delete old indices in tfw

const mongdbClient = require('mongodb').MongoClient;
const elasticsearch = require('elasticsearch');

let mongoClient = null;
let db = null;
let endDate = null;
let client = null;

const connectES = async () => {
client = elasticsearch.Client({
host: process.env.ES_URL
});
};

const connectMongoDb = async () => {
mongoClient = await mongdbClient.connect(process.env.MONGO_URL, { useUnifiedTopology: true });
db = mongoClient.db('test-framework');
};

const findStartDate = async () => {
let testScenarioIdsStr = '';
let testScenarioIds = [];
const scenarioCollection = db.collection('Scenario');
const cursor = scenarioCollection.find({
'officialTest': true
});
while (await cursor.hasNext()) {
let document = await cursor.next();
testScenarioIdsStr = testScenarioIdsStr + '\'' + String(document._id) + '\',' ;
testScenarioIds.push(String(document._id));
}
const testRunCollection = db.collection('TestResult');
testScenarioIdsStr = testScenarioIdsStr.substring(0, testScenarioIdsStr.length - 1);
let query = {
'created.on': { $exists: true },
'testRunConfigId': { $in: testScenarioIds }
};
let testRunCursor = testRunCollection.find(query).sort({ 'created.on': 1 }).limit(1);
while (await testRunCursor.hasNext()) {
const doc = await testRunCursor.next();
endDate = doc.created.on;
}
mongoClient.close();
};

const deleteESData = async () => {
await client.count({
index: process.env.ES_INDEX_NAME,
body: {
query: {
range: {
'@timestamp': {
lt: endDate
}
}
}
}
}).then(function(resp) {
return resp.count;
});
};

exports.handler = async () => {
const response = {
statusCode: 200,
body: 'TFW Lambda executed successfully',
};
await connectES();
await connectMongoDb();
await findStartDate();
await deleteESData();
return response;
};




python for fetching jira tickets:

import json

import requests as req
user = 'spkannan'
passwd = 'Corex@tfw123'

resp = req.get("https://workflow.ghx.com/rest/api/2/search?jql=project=CXTF AND key = CXTF-22",headers = {'Content-Type' : 'application/json'}, auth=(user, passwd))

print(resp.status_code)
if resp.status_code == 200:
    response_json = resp.json()
    issues = response_json['issues']
    for issue in issues:
        print(issue['key'])


import json

import requests as req
user = 'spkannan'
passwd = 'Corex@tfw123'
resp = req.get("https://workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query=CXTF-22", auth=(user, passwd))
sections = response_json['sections'][0]
for issue in sections['issues']:
    print(issue['key'])


https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-search/#api-rest-api-3-issue-picker-get


 System.out.println(SecurityContextHolder.getContext().getAuthentication());
        System.out.println("userName" + DAOUtil.getUserName());
        System.out.println("password" + SecurityContextHolder.getContext().getAuthentication().getCredentials());


#!/usr/bin/env python3
import json

import requests as req
user = 'spkannan'
passwd = 'Corex@tfw123'

'''resp = req.get("https://workflow.ghx.com/rest/api/2/search?jql=project=CXTF",headers = {'Content-Type' : 'application/json'}, auth=(user, passwd))'''
resp = req.get("https://workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework AND issuekeyE-2242&currentIssueKey=CXTF-1978&showSubTasks=true&showSubTaskParent=true&appId=&query=CXTF-22&_=1634745724544", auth=(user, passwd))
print(resp.status_code)
if resp.status_code == 200:
#print(resp.json())
response_json = resp.json()
#print(response_json)
#issues = response_json['issues']
sections = response_json['sections'][0]
for issue in sections['issues']:
print(issue['key'])

public static List<JiraIssueDetail> fetchJiraId(String issueKey) throws TestFWServerException {
List<JiraIssueDetail> jiraIssues = Lists.newArrayList();

Authentication auth = SecurityContextHolder.getContext().getAuthentication();
String startURL = new StringBuilder().append(HTTPS_PROTOCOL).append("workflow.ghx.com/rest/api/2/issue/picker"
+ "?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query=")
.append(issueKey)
.toString();
try {
RestTemplate restTemplate = SecurityUtil.getRestTemplate();
ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET,
new HttpEntity(createHeaders("spkannan",
"Corex@tfw123")),
String.class);
String body = output.getBody().toString();
JSONObject responseJson = new JSONObject(body);
JSONArray jsonArray = new JSONArray(responseJson.get("sections").toString());
JSONObject section = jsonArray.getJSONObject(0);
JSONArray issues = new JSONArray(section.get("issues").toString());
for (int i = 0; i < issues.length(); i++) {
JSONObject issue = issues.getJSONObject(i);
JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
jiraIssueDetail.setKey(issue.get("key").toString());
jiraIssueDetail.setSummary(issue.get("summary").toString());
jiraIssues.add(jiraIssueDetail);
}
System.out.println(jiraIssues);

} catch (Exception e) {
LOGGER.error("Error getting jira id", e);
}


if (jiraIssues.size() == 0) {
try {
startURL = new StringBuilder().append("https://").append("workflow.ghx.com/rest/api/2/search?jql=key =")
.append(issueKey.toUpperCase(Locale.US)).toString();
RestTemplate restTemplate = SecurityUtil.getRestTemplate();
ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET,
new HttpEntity(createHeaders("spkannan",
"Corex@tfw123")), String.class);
System.out.println(output);
String body = output.getBody().toString();
JSONObject responseJson = new JSONObject(body);
JSONArray issues = new JSONArray(responseJson.get("issues").toString());
for (int i = 0; i < issues.length(); i++) {
JSONObject issue = issues.getJSONObject(i);
JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
jiraIssueDetail.setKey(issue.get("key").toString());
JSONObject fields = issue.getJSONObject("fields");
jiraIssueDetail.setSummary(fields.get("summary").toString());
jiraIssues.add(jiraIssueDetail);
}
System.out.println(jiraIssues);
} catch (RestClientException | JSONException e) {
LOGGER.error("Error getting jira id", e);
throw new TestFWServerException("The issue key " + issueKey + " does not exist.");
}
}
System.out.println(jiraIssues);

return jiraIssues;
}
public static void main(String[] args) {
try {
fetchJiraId("EGXC-36165");
} catch (TestFWServerException e) {
// TODO Auto-generated catch block
e.printStackTrace();
System.out.println(e.toString());
}
}


 /*
         * return new HttpHeaders() {{
         * String auth = username + ":" + password;
         * byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(Charset.forName("US-ASCII")));
         * String authHeader = "Basic " + new String(encodedAuth);
         * set("Authorization", authHeader);
         * }};
         */

For connecting to ec2 instance from file zilla:
1. ui-hemidal execute the below comment
chmod -R 777 /var/lib/tomcat/webapps/ROOT/WEB-INF/lib

2. build local testframework api jar
3. connect to filezilla ..select target folder
source folder : /home/sys-user/project/corex-coe/git-small/all/test-framework/test-framework-api/target
destination folder: /var/lib/tomcat/webapps/ROOT/WEB-INF/lib

4. systemctl stop tomcat

5. In Filezilla move testframework api jar from source folder to destination folder

6. systemctl start tomcat


#####################rough#####################

 public exportTestResultsComparisonData():void {
        this.exportCompareResultLabel = this.localization.getValue('testframework.exportComparison.downloadingLabel');
        this.loading = true;
        try {
           

            html2canvas(this.exportId).then(canvas => {
                const contentDataURL = canvas.toDataURL('image/png')  
                //let pdf = new jsPDF('l', 'cm', 'a4'); //Generates PDF in landscape mode
                // let pdf = new jspdf('p', 'cm', 'a4'); Generates PDF in portrait mode
                let canvasPdf = new jsPDF('p', 'mm', 'a4');

                var height = canvas.height;
                var width = canvas.width;
               
                var imgWidth = 210;
                var pageHeight = 297;
                var imgHeight = height * imgWidth / width;
                var heightLeft = imgHeight;
          
                var position = 0;
          
                canvasPdf.addImage(contentDataURL, 'PNG', 0, position, imgWidth, imgHeight+10);
                heightLeft -= pageHeight;
          
                while (heightLeft >= 0) {
                    position = heightLeft - imgHeight;
                    canvasPdf.addPage();
                    canvasPdf.addImage(contentDataURL, 'PNG', 0, position, imgWidth, imgHeight+10);
                    heightLeft -= pageHeight;
                }
               // pdf.addImage(contentDataURL, 'PNG', 0, 0, 29.7, 21.0);  
               
               
               canvasPdf.save('Filename.pdf');   
              }); 
            var pdf = new jsPDF('p', 'mm', 'a4');
            // pdf.html(
            //     this.exportId, {
            //     callback: function (pdf) {
            //         pdf.save("test.pdf");
            //     },
            // });
          domtoimage.toPng(this.exportId)
            .then((blob:any)=> {
             // var width = pdf.internal.pageSize.getWidth();
              var height = pdf.internal.pageSize.getHeight();
            //  pdf.addImage(blob, 'PNG', 0, 0, width, height/2);
            //   var pages =(this.exportId).length;
            //   console.log(pages);
            //   pdf.addPage();
            //   pdf.addImage(blob, 'PNG', 50, 100, width, 300);
           // this.getChildren();
           var imgWidth = 210;
           var pageHeight = 297;
           var imgHeight = height * imgWidth / 100;
           var heightLeft = imgHeight;
     
           var position = 0;
     
           pdf.addImage(blob, 'PNG', 0, position, imgWidth, imgHeight+10);
           heightLeft -= pageHeight;
     
           while (heightLeft >= 0) {
               position = heightLeft - imgHeight;
               pdf.addPage();
               pdf.addImage(blob, 'PNG', 0, position, imgWidth, imgHeight+10);
               heightLeft -= pageHeight;
           }
         pdf.save("Dashboard.pdf");
     
            // domtoimage.toPng(this.cpuNonCputable)
            // .then((blob1:any)=> {
            //     pdf.addPage();
            //     var width = pdf.internal.pageSize.getWidth();
            //     var height = pdf.internal.pageSize.getHeight();
            //     pdf.addImage(blob, 'PNG', 0, 0, width, height);
            // });
            //   pdf.save('compareMetrics.pdf');
//               var data = pdf.output();
// var buffer = new ArrayBuffer(data.length);
// var array = new Uint8Array(buffer);
// for (var i = 0; i < data.length; i++) {
//     array[i] = data.charCodeAt(i);
// }

// var blob1 = new Blob(
//     [array],
//     {type: 'application/pdf'}
// );
// console.log(blob1);
// FileSaver.saveAs(blob1);
//pdf.addImage(blob1, 'PNG', 0, 0, width, height);

//pdf.save('compareMetrics.pdf');
              this.exportCompareResultLabel = this.localization.getValue('testframework.testresults.comparisondata.export');
              this.loading = false;
            });
        } catch (error) {
            this.notifications.error(
                this.localization.getValue('testframework.exportfailed'),
            );
        }
    }

#####################original##############


    public exportTestResultsComparisonData():void {
        this.exportCompareResultLabel = this.localization.getValue('testframework.exportComparison.downloadingLabel');
        this.loading = true;
        try {
            html2canvas(this.exportId).then(canvas => {
                const contentDataURL = canvas.toDataURL('image/png')  
                let canvasPdf = new jsPDF('p', 'mm', 'a4');

                let height = canvas.height;
                let width = canvas.width;
               
                let imgWidth = 210;
                let pageHeight = 297;
                let imgHeight = height * imgWidth / width;
                let heightLeft = imgHeight;
          
                let position = 0;
          
                canvasPdf.addImage(contentDataURL, 'PNG', 0, position, imgWidth, imgHeight+10);
                heightLeft -= pageHeight;
          
                while (heightLeft >= 0) {
                    position = heightLeft - imgHeight;
                    canvasPdf.addPage();
                    canvasPdf.addImage(contentDataURL, 'PNG', 0, position, imgWidth, imgHeight+10);
                    heightLeft -= pageHeight;
                }
                              
                canvasPdf.save('compareMetrics.pdf');   
                this.exportCompareResultLabel = this.localization.getValue('testframework.testresults.comparisondata.export');
                this.loading = false;
            });
        } catch (error) {
            this.notifications.error(
                this.localization.getValue('testframework.exportfailed'),
            );
        }
    }






  @ViewChild('exportCompare', {read: ViewContainerRef}) exportCompare: any;
    @ViewChild("cpuNonCputable") private cpuNonCputableRef: ElementRef<HTMLElement>;
@ViewChild('exportCompare')  public exportCompare: ElementRef;

public getChildren():void {
  const parentElement = this.cpuNonCputableRef.nativeElement;
  const firstChild = parentElement.children[0];
  const firstImage = parentElement.querySelector("cpuNonCputable");
 console.log(firstChild);
 console.log(firstImage);
}

<div *ngIf="isBarChartEnabled">
    <span #ContainerRef fxFlex="98" fxLayoutAlign="left center">
        <ngx-charts-bar-vertical [view]="[ContainerRef.offsetWidth, 380]" [scheme]="colorScheme"
            [results]="barChartData" [gradient]="gradient" [xAxis]="showXAxis" [yAxis]="showYAxis"
            [legendPosition]="legendPosition" [legend]="showLegend" [showXAxisLabel]="showXAxisLabel"
            [animations]="animation" [showYAxisLabel]="showYAxisLabel" [xAxisLabel]="xAxisLabel"
            [legendTitle]="legendTitle" [yAxisLabel]="yAxisLabel" (select)="onSelect($event)" [barPadding]="barPadding"
            [noBarWhenZero]="false" [showDataLabel]="showDataLabel">
        </ngx-charts-bar-vertical>
    </span>
</div>

<div *ngIf="isPieChartEnabled">
    <span #ContainerRef fxFlex="98" fxLayoutAlign="left center">
        <ngx-charts-pie-chart [view]="[ContainerRef.offsetWidth, 380]" [scheme]="colorScheme" [results]="pieChartData"
            [gradient]="gradient" [legend]="showLegend" [legendTitle]="legendTitle" [legendPosition]="legendPosition"
            [labels]="showLabels" [doughnut]="isDoughnut" [explodeSlices]="explodeSlices" [animations]="animation"
            (select)="onSelect($event)" (activate)="onActivate($event)" (deactivate)="onDeactivate($event)"
            (labelFormatting)="labelFormatting($event)">
        </ngx-charts-pie-chart>
    </span>
</div>

<div *ngIf="isLineChartEnabled">
    <span #ContainerRef fxFlex="98" fxLayoutAlign="left center">
        <ngx-charts-line-chart [view]="[ContainerRef.offsetWidth, 380]" [scheme]="colorScheme" [results]="lineChartData"
            [gradient]="gradient" [xAxis]="showXAxis" [yAxis]="showYAxis" [legend]="showLegend"
            [xAxisLabel]="xAxisLabel" [yAxisLabel]="lineChartYAxisLabel" [showXAxisLabel]="true" [showYAxisLabel]="true"
            [animations]="animation" legendTitle="''" legendPosition="legendPosition" [autoScale]="autoScale" [timeline]="timeline"
            [roundDomains]="true" class="line-chart">
        </ngx-charts-line-chart>
    </span>
</div>


<span #ContainerRef fxFlex="98" fxLayoutAlign="left center">
                    <ngx-charts-line-chart
                        [view]="[ContainerRef.offsetWidth, 380]"
                        [scheme]="colorScheme"
                        [results]="chartResults"
                        [gradient]="gradient"
                        [xAxis]="showXAxis"
                        [yAxis]="showYAxis"
                        [legend]="showLegend"
                        [xAxisLabel]="xAxisLabel"
                        [yAxisLabel]="yAxisLabel"
                        [showXAxisLabel]="true"
                        [showYAxisLabel]="true"
                        [animations]="animation"
                        legendTitle=""
                        legendPosition="left"
                        [autoScale]="autoScale"
                        [timeline]="timeline"
                        [roundDomains]="true"
                        class="line-chart"
                    >
                    </ngx-charts-line-chart>
                </span>


7049)&#x29;
2021-06-23 22:42:14,733 |DEBUG [https-jsse-nio-8443-exec-137] c.g.t.a.d.EBExecutionRunTimeBusinessStatisticsDAO - ebExecutionRunTimeBusinessStatisticsAggregation.Inside DAO AggTime&#x3a;[]
2021-06-23 22:42:14,733 |DEBUG [https-jsse-nio-8443-exec-137] c.g.t.a.d.EBExecutionRunTimeBusinessStatisticsDAO - engineName&#x3a;Engine-IO,name&#x3a;bus.publish.events.per.hour,fromDate&#x3a;2021-06-24 04:34:07.584,toDate&#x3a;2021-06-24 04:42:12.195
2021-06-23 22:42:15,835 |DEBUG [https-jsse-nio-8443-exec-137] c.g.t.a.d.EBExecutionRunTimeBusinessStatisticsDAO - ebExecutionRunTimeBusinessStatisticsAggregation.Inside DAO AggTime&#x3a;[]
2021-06-23 22:42:15,836 |DEBUG [https-jsse-nio-8443-exec-137] c.g.t.a.d.EBExecutionRunTimeBusinessStatisticsDAO - engineName&#x3a;Engine-PE,name&#x3a;bus.publish.events.per.second,fromDate&#x3a;2021-06-24 04:34:07.584,toDate&#x3a;2021-06-24 04:42:12.195


createQuery().field(ENGINENAME).equalIgnoreCase(engineName).field("componentId")
.equal("eventbus").field("name").equal(name).field("type").equal("NUMERIC").field(TIME)
.greaterThanOrEq(Timestamp.valueOf(fromDate)).field(TIME)
.lessThanOrEq(Timestamp.valueOf(toDate))

db.getCollection('EBExecutionRunTimeBusinessStatistics').find({"engineName":"ENGINE-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":$gte{Timestamp.valueOf("2021-06-24 04:34:07.584")}},"time":$lte{(Timestamp.valueOf("2021-06-24 04:42:12.195")}}})

.group(Group.id(grouping("month", new Accumulator("$month", TIME)),
grouping("day", new Accumulator("$dayOfMonth", TIME)),
grouping("year", new Accumulator("$year", TIME)),
grouping("hour", new Accumulator("$hour", TIME)),
grouping("minutes", new Accumulator("$minute", TIME)), grouping(ENGINENAME, ENGINENAME)),
grouping("totalValue", new Accumulator("$sum", "value")))

$group :
  {"Month" : "$date.month", 
}


.project(projection("month", "_id.month"), projection("day", "_id.day"), projection("year", "_id.year"),
projection("hour", "_id.hour"), projection("minutes", "_id.minutes"),
projection("engineName", "_id.engineName"), projection("totalValue", "totalValue"))


"$project" : {
                "date" : {
                    "$dateFromString" : {
                        "dateString" : "$createdAt", 
                        "onError" : "$date"
                    }
                }, 



{$project : { 
          month : {$month : "_id.month"}, 
          year : {$day :  "_id.day"},

      }},



db.getCollection('EBExecutionRunTimeBusinessStatistics').find({"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195")}}).aggregate({ "$group" : {"_id": {"year" : { "$year" : "time" }, "month" : { "$month" : "time" },"day" : { "$dayOfMonth" : "time" }}}});





{ $match : {"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195") } }


db.EBExecutionRunTimeBusinessStatisticsAgg.aggregate([{ $match : {"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195") } },{"$group" : {"_id": {"month":{ "$month":"time"}}}}]);


db.EBExecutionRunTimeBusinessStatisticsAgg.aggregate([{ $match : {"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195") }}}])



db.EBExecutionRunTimeBusinessStatistics.aggregate([{ $match : {"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195") }}},{"$group":{"_id":{"month":{"$month": "$time"},"day":{"$dayOfMonth":"$time"},"year":{"$year":"$time"},"hour":{"$hour":"$time"},"minutes":{"$minute":"$time"},"totalValue":{"$sum":"$value"}}}}])



db.EBExecutionRunTimeBusinessStatistics.aggregate([
{
   "$match":{
      "engineName":"Engine-PE",
      "componentId":"eventbus",
      "name":"bus.publish.events.per.hour",
      "type":"NUMERIC",
      "time":{
         "$gte":"ISODate(""2021-06-24 04:34:07.584"")",
         "$lte":"ISODate(""2021-06-24 04:42:12.195"")"
      }
   }
},
{
   "$group":{
      "_id":{
         "month":{
            "$month":"$time"
         },
         "day":{
            "$dayOfMonth":"$time"
         },
         "year":{
            "$year":"$time"
         },
         "hour":{
            "$hour":"$time"
         },
         "minutes":{
            "$minute":"$time"
         },
         "totalValue":{
            "$sum":"$value"
         }
      }
   }
}
,
{
"$project":{
"month": "_id.month"
}])



db.EBExecutionRunTimeBusinessStatistics.aggregate([{ $match : {"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195") }}},{"$group":{"_id":{"month":{"$month": "$time"},"day":{"$dayOfMonth":"$time"},"year":{"$year":"$time"},"hour":{"$hour":"$time"},"minutes":{"$minute":"$time"},"totalValue":{"$sum":"$value"}}}},{"$project":{"month": "_id.month","day", "_id.day","year", "_id.year","hour", "_id.hour","minutes", "_id.minutes","engineName", "_id.engineName","totalValue", "totalValue"}}])

>>>>>>>>>>>>>>>>>>>>>>>>>>

>>>project[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}]

db.getCollection('TestResult').aggregate([{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}])


>>>sort[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}]

db.getCollection('TestResult').aggregate([{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}]);

>>>skip[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}]


>>>limit[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}]

db.getCollection('TestResult').aggregate([{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}])


 org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/json-io-2.6.0.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/rsyntaxtextarea-2.6.1.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/cron-utils-8.0.0.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/tagsoup-1.2.1.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/byte-buddy-1.10.21.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/woden-api-1.0M8.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/aggs-matrix-stats-client-7.4.2.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/local-cache-scheduler-1.1.2.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/stats-engine-2.6.0-SNAPSHOT.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/spring-data-commons-1.10.0.RELEASE.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/jakarta.activation-api-1.2.1.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/ews-2.6.0-SNAPSHOT.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/commons-email-1.5.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/tracked-config-impl-2.1.0.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/aspectjweaver-1.8.7.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/datapoller-2.6.0-SNAPSHOT.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/apache-mime4j-core-0.7.2.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/sms-proxied-3.6.0.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache backgroundProcess
INFO: The background cache eviction process was unable to free [10] percent of the cache for Context [/ui-heimdall] - consider increasing the maximum size of the cache. After eviction approximately [10,239] KB of data remained in the cache.
2021-08-02 23:28:50,300 |INFO [http-nio-8080-exec-1] com.ghx.web.filter.security.CRLFFilter - Url &#x3a; 
2021-08-02 23:28:50,300 |INFO [http-nio-8080-exec-1] com.ghx.web.filter.security.CRLFFilter - CRLF enabled true
2021-08-02 23:28:50,300 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - user spkannan (id=1700) attempt to access com.ghx.tpm.rest.system.monitoring.SystemStatusRESTService.stoppedAndThrottled&#x28;[]&#x29;
2021-08-02 23:28:50,301 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - user spkannan (id=1700) attempt to access com.ghx.tpm.rest.system.monitoring.cache.ComponentAndAdapterStatusMonitoringConfigCacheImpl.getCacheNameKey&#x28;[]&#x29;
2021-08-02 23:28:50,301 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - Access to com.ghx.tpm.rest.system.monitoring.cache.ComponentAndAdapterStatusMonitoringConfigCacheImpl granted to getCacheNameKey.[]&#x28;user spkannan (id=1700)&#x29;
2021-08-02 23:28:50,301 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - user spkannan (id=1700) attempt to access com.ghx.tpm.rest.system.monitoring.cache.ComponentAndAdapterStatusMonitoringConfigCacheImpl.get&#x28;[componentAndAdapterStatusCache, com.ghx.tpm.rest.system.monitoring.SystemStatusRESTService$$Lambda$1654/0x00000001020cf040@3c865021]&#x29;
2021-08-02 23:28:50,303 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - user spkannan (id=1700) attempt to access com.ghx.tpm.rest.system.monitoring.ComponentAdapterReportingServiceImpl.getCurrentComponentAndAdapterStatusReport&#x28;[com.ghx.system.monitoring.model.dto.StoppedListenersDto@4cbc775d]&#x29;
2021-08-02 23:28:50,303 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - Access to com.ghx.tpm.rest.system.monitoring.ComponentAdapterReportingServiceImpl granted to getCurrentComponentAndAdapterStatusReport.[com.ghx.system.monitoring.model.dto.StoppedListenersDto@4cbc775d]&#x28;user spkannan (id=1700)&#x29;
2021-08-02 23:28:50,303 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - Access to com.ghx.tpm.rest.system.monitoring.cache.ComponentAndAdapterStatusMonitoringConfigCacheImpl granted to get.[componentAndAdapterStatusCache, com.ghx.tpm.rest.system.monitoring.SystemStatusRESTService$$Lambda$1654/0x00000001020cf040@3c865021]&#x28;user spkannan (id=1700)&#x29;
2021-08-02 23:28:50,303 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - Access to com.ghx.tpm.rest.system.monitoring.SystemStatusRESTService granted to stoppedAndThrottled.[]&#x28;user spkannan (id=1700)&#x29;
2021-08-02 23:28:51,815 |WARN [EGXLocal-EVENT_BUS_SCHEDULER_Worker-7] com.ghx.eb.impl.rebalance.ListenerRebalancer - LISTENER_REBALANCER CACHE - Null or empty map returned from listenerStatusService.retrieveAll&#x28;UserName_sys-user_98353&#x29;
2021-08-02 23:28:51,815 |INFO [EGXLocal-EVENT_BUS_SCHEDULER_Worker-7] com.ghx.eb.impl.rebalance.ListenerRebalancer - 
Listener CACHE:Local :
>>>limit[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion", "updated.on": "$updated.on"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}]
2021-08-02 23:28:56,817 |WARN [EGXLocal-EVENT_BUS_SCHEDULER_Worker-9] com.ghx.eb.impl.rebalance.ListenerRebalancer - LISTENER_REBALANCER CACHE - Null or empty map returned from listenerStatusService.retrieveAll&#x28;UserName_sys-user_98353&#x29;
2021-08-02 23:28:56,817 |INFO [EGXLocal-EVENT_BUS_SCHEDULER_Worker-9] com.ghx.eb.impl.rebalance.ListenerRebalancer - 
Listener CACHE:Local :
2021-08-02 23:28:57,463 |ERROR [http-nio-8080-exec-5] c.g.w.exception.ExceptionToHTTPStatusResolver - Resolving exception
com.mongodb.MongoCommandException: Command failed with error 16412 (Location16412): 'FieldPath field names may not contain '.'.' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "FieldPath field names may not contain '.'.", "code": 16412, "codeName": "Location16412"}
at com.mongodb.internal.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:175) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:303) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:259) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:99) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:450) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:72) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:218) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:269) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:131) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:123) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.CommandOperationHelper.executeCommand(CommandOperationHelper.java:343) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.CommandOperationHelper.executeCommand(CommandOperationHelper.java:334) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.CommandOperationHelper.executeCommandWithConnection(CommandOperationHelper.java:220) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.CommandOperationHelper$5.call(CommandOperationHelper.java:206) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.OperationHelper.withReadConnectionSource(OperationHelper.java:463) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.CommandOperationHelper.executeCommand(CommandOperationHelper.java:203) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.AggregateOperationImpl.execute(AggregateOperationImpl.java:200) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.AggregateOperation.execute(AggregateOperation.java:333) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.AggregateOperation.execute(AggregateOperation.java:42) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:189) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:170) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.DBCollection.aggregate(DBCollection.java:1530) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.DBCollection.aggregate(DBCollection.java:1488) ~[mongo-java-driver-3.11.2.jar:na]
at dev.morphia.aggregation.AggregationPipelineImpl.aggregate(AggregationPipelineImpl.java:84) ~[core-1.5.3.jar:na]
at dev.morphia.aggregation.AggregationPipelineImpl.aggregate(AggregationPipelineImpl.java:75) ~[core-1.5.3.jar:na]
at dev.morphia.aggregation.AggregationPipelineImpl.aggregate(AggregationPipelineImpl.java:64) ~[core-1.5.3.jar:na]
at com.ghx.testframework.api.dao.TestResultDAO.getReleaseVersions(TestResultDAO.java:546) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at com.ghx.testframework.api.service.impl.TestResultServiceImpl.getReleaseVersions(TestResultServiceImpl.java:1233) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at com.ghx.testframework.api.rest.TestResultRESTService.getReleaseVersions(TestResultRESTService.java:371) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at com.ghx.testframework.api.rest.TestResultRESTService$$FastClassBySpringCGLIB$$216c3552.invoke(<generated>) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:100) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at com.ghx.access.control.core.authorization.SecurityAnnotationProcessor.applySecurity(SecurityAnnotationProcessor.java:130) ~[security-commons-2.6.0-SNAPSHOT.jar:na]
at com.ghx.access.control.core.authorization.SecurityAnnotationProcessor.process(SecurityAnnotationProcessor.java:98) ~[security-commons-2.6.0-SNAPSHOT.jar:na]
at com.ghx.access.control.BaseSecurityAspect.doProcessAccessControl(BaseSecurityAspect.java:88) ~[security-commons-2.6.0-SNAPSHOT.jar:na]
at com.ghx.access.control.BaseSecurityAspect.doProcessAccessControl(BaseSecurityAspect.java:77) ~[security-commons-2.6.0-SNAPSHOT.jar:na]
at com.ghx.heimdall.service.GHXHeimdallSecurityAspect.doProcessAccessControl(GHXHeimdallSecurityAspect.java:43) ~[rest-heimdall-2.6.0-SNAPSHOT.jar:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) ~[spring-security-core-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at com.ghx.testframework.api.rest.TestResultRESTService$$EnhancerBySpringCGLIB$$14812954.getReleaseVersions(<generated>) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at com.ghx.testframework.api.rest.TestResultRESTService$$FastClassBySpringCGLIB$$216c3552.invoke(<generated>) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) ~[spring-security-core-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at com.ghx.testframework.api.rest.TestResultRESTService$$EnhancerBySpringCGLIB$$a3da246a.getReleaseVersions(<generated>) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:207) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:890) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) ~[servlet-api.jar:na]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at com.ghx.web.filter.SessionTimeoutTrackingFilter.doFilter(SessionTimeoutTrackingFilter.java:63) ~[classes/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:155) ~[spring-orm-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at com.ghx.web.filter.ProductHandleURLFilter.doFilter(ProductHandleURLFilter.java:55) ~[classes/:na]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at com.ghx.web.filter.security.CRLFFilter.doFilter(CRLFFilter.java:77) ~[classes/:na]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at com.ghx.security.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:48) ~[security-commons-2.6.0-SNAPSHOT.jar:na]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at com.ghx.web.filter.ExpiredSessionFilter.doFilter(ExpiredSessionFilter.java:97) ~[classes/:na]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:120) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at com.ghx.web.filter.IECompatibilityFilter.doFilter(IECompatibilityFilter.java:23) ~[classes/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) ~[catalina.jar:8.5.0]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) ~[catalina.jar:8.5.0]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) ~[catalina.jar:8.5.0]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[catalina.jar:8.5.0]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1096) ~[tomcat-coyote.jar:8.5.0]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-coyote.jar:8.5.0]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:760) ~[tomcat-coyote.jar:8.5.0]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1480) ~[tomcat-coyote.jar:8.5.0]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:8.5.0]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]


>>>limit[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion", "updated": "$updated"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}]


>>>limit[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion", "updated": "$updated"}, "unique_release": {"$addToSet": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"unique_release": "$unique_release", "releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}]

>>>>>>>>>>>>>>>>>>>>>>

         <!-- <button
                                                    mat-icon-button
                                                    class="commentBtn"
                                                    color="accent"
                                                    type="button"
                                                    top-actions-buttons
                                                    [disabled]="selectedConnection?.length === 0"
                                                    (click)="deleteComment(selectedTestResult.id, i)"
                                                    data-testid="SupplierContactListRouteAgGridTopActionsDeleteButton"
                                                >
                                                    <mat-icon
                                                        matTooltipPosition="above"
                                                        [matTooltip]="'supplierContact.deleteSupplier' | l10n"
                                                    >
                                                        delete
                                                    </mat-icon>
                                                </button> -->

                                        <!-- <button
                                                mat-icon-button
                                                color="accent"
                                                type="button"
                                                top-actions-buttons
                                                [disabled]="selectedConnection?.length === 0"
                                                (click)="deleteComment(selectedTestResult.id, i)"
                                                data-testid="SupplierContactListRouteAgGridTopActionsDeleteButton"
                                            > -->


<!-- <div fxLayout="column" fxFlex>
                                        <div fxLayout="row" *ngIf="selectedTestResult.id" fxLayoutAlign="end start">
                                            <button color="accent" mat-button type="button"
                                            class="md-icon-button" fxLayoutAlign="left center"
                                            [disabled]="viewBaseLineHeaderTabEnable"
                                            (click)="addJira('jira','',jira,selectedTestResult.id)">
                                            <mat-icon>add_circle</mat-icon>
                                        </button>
                                            <!-- <button fxLayoutAlign="center center" mat-button 
                                    class="commentBtn"
                                    (click)=""> 
                                        {{'label.add' | l10n}}
                                    </button>--><!--</div></div> -->


                                        <!-- <button fxLayoutAlign="center center" mat-button 
                                                    class="commentBtn"
                                                    (click)="addComment('jira',testResultJiraTicket,jira,selectedTestResult.id)">
                                                        {{'label.add' | l10n}}
                                                    </button>  -->

    <!-- <button
                                                    mat-icon-button
                                                    color="accent"
                                                    type="button"
                                                    top-actions-buttons
                                                    [disabled]="selectedConnection?.length === 0"
                                                    (click)="deleteComment(selectedTestResult.id, jira)"
                                                    data-testid="SupplierContactListRouteAgGridTopActionsDeleteButton"
                                                >
                                                    <mat-icon
                                                        matTooltipPosition="above"
                                                        [matTooltip]="'supplierContact.deleteSupplier' | l10n"
                                                    >
                                                        delete
                                                    </mat-icon>
                                                </button> -->

                                        <!-- <span fxLayout="row" fxFlex="100%"> -->

   <!-- <button color="accent" mat-button type="button"
                                            class="add-comment-jira" fxLayoutAlign="left center"
                                            [ngClass] = "{'disable-input': viewBaseLineHeaderTabEnable == true}"
                                            [disabled]="viewBaseLineHeaderTabEnable"
                                            (click)="addComment('comment','',i,selectedTestResult.id)">
                                           
                                <mat-icon>add_circle</mat-icon></button>
                        
                                <mat-tab mat-active="false" style="float: right;"> 
                                    <ng-template mat-tab-label>
                                    <div fxLayout="column" fxFlex>
                                        <div fxLayout="row" *ngIf="selectedTestResult.id" fxLayoutAlign="end start">
                                            <button color="accent" mat-button type="button"
                                            class="add-comment-jira" fxLayoutAlign="left center"
                                            [ngClass] = "{'disable-input': viewBaseLineHeaderTabEnable == true}"
                                            [disabled]="viewBaseLineHeaderTabEnable"
                                            (click)="addComment('comment','',i,selectedTestResult.id)">
                                            <mat-icon>add_circle</mat-icon>
                                        </button> 
                                    </div>  </div></ng-template> -->
                <!-- <ng-template mat-tab-label>
                                        <button mat-icon-button 
                                        color="accent"
                                        class="md-icon-button" fxLayoutAlign="left center"
                                        [ngClass] = "{'disable-input': viewBaseLineHeaderTabEnable == true}"
                                        [disabled]="viewBaseLineHeaderTabEnable"
                                        (click)="someFn()">
                                            <mat-icon>add_circle</mat-icon>
                                        </button>
                                    </ng-template> -->
                <!-- </mat-tab> -->
                <!-- <mat-tab *ngIf="selectedTestResult.id" label="{{'homePage.comments' | l10n}}">  
                                    <ng-template fxLayoutAlign="end start">
                                     <div fxLayout="row"  class="commentBtn" fxFlex>   -->
                <!-- <button color="accent" mat-button type="button"
                                        class="md-icon-button" fxLayoutAlign="left center"
                                        [ngClass] = "{'disable-input': viewBaseLineHeaderTabEnable == true}"
                                        [disabled]="viewBaseLineHeaderTabEnable"
                                        (click)="addComment('comment','',i,selectedTestResult.id)">
                                        <mat-icon>add_circle</mat-icon>
                                    </button>  
                                   </ng-template></mat-tab> -->

 <!-- <button fxLayoutAlign="center center" mat-button 
                                                    class="commentBtn"
                                                    (click)="addComment('comment',testResultComment.comment,i,selectedTestResult.id)">
                                                        {{'label.add' | l10n}}
                                                    </button>  -->

 <!-- <div fxLayout="column" fxFlex>
                                            <div fxLayout="row" *ngIf="selectedTestResult.id" fxLayoutAlign="end start">
                                                <button color="accent" mat-button type="button"
                                                class="md-icon-button" fxLayoutAlign="left center"
                                                [ngClass] = "{'disable-input': viewBaseLineHeaderTabEnable == true}"
                                                [disabled]="viewBaseLineHeaderTabEnable"
                                                (click)="addComment('comment','',i,selectedTestResult.id)">
                                                <mat-icon>add_circle</mat-icon>
                                            </button> 
                                        </div>  
                                    </div> -->
                    <!-- <mat-expansion-panel [expanded]="false" class="comment-panel-title">
                                            <mat-expansion-panel-header>
                                                teststs
                                                </mat-expansion-panel-header>
                                        </mat-expansion-panel> -->
                    <!-- <mat-panel-title>

                                        <div fxLayout="column" fxFlex>
                                            <div fxLayout="row" *ngIf="selectedTestResult.id" fxLayoutAlign="end start">
                                                <button color="accent" mat-button type="button"
                                                class="md-icon-button" fxLayoutAlign="left center"
                                                [ngClass] = "{'disable-input': viewBaseLineHeaderTabEnable == true}"
                                                [disabled]="viewBaseLineHeaderTabEnable"
                                                (click)="addComment('comment','',i,selectedTestResult.id)">
                                                <mat-icon>add_circle</mat-icon>
                                            </button> 
                                        </div>  
                                    </div></mat-panel-title>
                                </div></div> -->

    <!-- <div class="add-comment-jira">
                            <mat-icon>add_circle</mat-icon>
                        </div> -->
            <!-- <mat-toolbar>
                                <div fxLayout="column" fxFlex>
                                    <div fxLayout="row" *ngIf="selectedTestResult.id" fxLayoutAlign="end start">
                                        <button color="accent" mat-button type="button"
                                        class="add-comment-jira" fxLayoutAlign="left center"
                                        [ngClass] = "{'disable-input': viewBaseLineHeaderTabEnable == true}"
                                        [disabled]="viewBaseLineHeaderTabEnable"
                                        (click)="addComment('comment','',i,selectedTestResult.id)">
                                        <mat-icon>add_circle</mat-icon>
                                    </button> 
                                </div>  
                            </div></mat-toolbar> -->

 <!-- <div *ngIf="selectedTestResult.id" fxLayoutAlign="end start">
                                    <button color="accent" mat-button type="button"
                                    class="add-comment-jira" fxLayoutAlign="left center"
                                    [ngClass] = "{'disable-input': viewBaseLineHeaderTabEnable == true}"
                                    [disabled]="viewBaseLineHeaderTabEnable"
                                    (click)="commentJiraTabSelection === 'COMMENTS' ?addComment('comment','',i,selectedTestResult.id) : addJira('jira','',jira,selectedTestResult.id)">
                                    <mat-icon>add_circle</mat-icon>
                                </button> 
                            </div>   -->

mat-form-field

mat-input

mat-datepicker

ngx-chart

number-card

ag-grid

mat-icon

any-icon

We have UI workshop videos in a CoreUI channel on stream. Let's add the recording for this there. This is great info to have on there. https://web.microsoftstream.com/channel/e07f239d-ba34-4cd0-8ecc-31aee4393bce 

https://hub.ghx.com/display/CDM/Developer+Notes%3A+Angular+Architecture+-+Presentational+Container+Pattern 


ANGULAR UNDERSTANDING:

breadscrum
navigator interface

index.ts:
 
path


export const appRoutesSchema: Routes = [
    {
        path: '',
        component: AppComponent,
        canActivateChild: [AuthenticatedGuard],
        children: [
            {
                path: 'account',
                loadChildren: './modules/Account/account.module#AccountModule',
            },

            {
                path: 'admin',
                loadChildren: './modules/Admin/admin.module#AdminModule',
            },
            {
                path: 'runhistory',
                loadChildren: './modules/RunHistory/custom-runhistory#CustomRunHistoryModule'
            }

module -> index.ts

import { CustomRunHistoryRouteComponent } from './CustomRunHistoryRoute/custom-runhistory-route.component';
import { AppRoutes } from 'src/app/interfaces/navigation.interface';
import { BreadCrumbsOperationsService } from 'src/app/store';

@Component({
    templateUrl: './view.html',
})
export class Container implements OnInit, OnDestroy {
    constructor(
        private localization: LocalizationService,
        private breadCrumbsOperations: BreadCrumbsOperationsService,
    ) {}

    private navigationState: IBreadCrumbsState = {
        id: Math.random(),
        level: 1,
        title: this.localization.getValue('header.documents'),
        href: AppRoutes.documents,
    };

    public ngOnInit(): void {
        this.breadCrumbsOperations.addStateToBreadCrumbs(this.navigationState);
    }

    public ngOnDestroy(): void {
        this.breadCrumbsOperations.removeStateToBreadCrumbs(this.navigationState);
    }
}

export const appRoutesSchema: Routes = [
    {
        path: '',
        component: Container,
        children: [
            {
                path: '',
                component: CustomRunHistoryRouteComponent,
                //canDeactivate: [CanDeactivateGuard],
                //children: [
                //  { path: ':id' }, //Component-less route just so we can detect route changes during email expand
                // ],
            },
        ],
    },
];



CustomRunHistoryModule:

inject CustomRunHistoryRouteModule in CustomRunHistoryModule

CustomRunHistoryRouteModule:
   exports: [CustomRunHistoryRouteComponent],
    //exports: [],
    declarations: [CustomRunHistoryRouteComponent],
    //declarations: [],

CustomRunHistoryRouteComponent:

@Component({
    templateUrl: './custom-runhistory-route.component.html',
    changeDetection: ChangeDetectionStrategy.OnPush,
})


 public options: AgOptionsInterface = this.config.preparedGridOptions;
    public topActions: IAgGridActions = {
        clearFilters: true,
        refresh: true,
    };

  constructor(
        public tableActions: DocumentsListRouteOperations,
        private config:CustomRunHistoryTableConfig,






outer index.ts-> overall CustomRunHistoryModule -> CustomRunHistoryRouteModule,index.ts -> CustomRunHistoryRouteComponent


BehaviorSubject, concatmap, forjoin, subject ,next, viewchild, ngdestroy,this.componentDestroyed$,     private componentDestroyed$: Subject<void> = new Subject();
 public ngOnDestroy(): void {
        this.componentDestroyed$.next();
        this.componentDestroyed$.complete();
    }

map, filter, *ngfor and *ngif no on same tag, use ng-container, use ng-template for single instance

take Until, take(1), switchMap
index.ts -> navigator.ts

ARIVU KT:

logmsg
c.g.a.u.s.d.AbstractDynamoDbSequenceGeneratorDAO - Failed saving of incremented sequence number
com.amazonaws.services.dynamodbv2.model.ConditionalCheckFailedException: The conditional request failed (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ConditionalCheckFailedException; Request ID: 67R3RE2C518GMC9H4FO42U27TNVV4KQNSO5AEMVJF66Q9ASUAAJG)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1632) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1304) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1058) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.doInvoke(AmazonDynamoDBClient.java:3452) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:3428) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.executeUpdateItem(AmazonDynamoDBClient.java:3160) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.updateItem(AmazonDynamoDBClient.java:3135) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper$SaveObjectHandler.doUpdateItem(DynamoDBMapper.java:853) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper$2.executeLowLevelRequest(DynamoDBMapper.java:593) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper$SaveObjectHandler.execute(DynamoDBMapper.java:732) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.save(DynamoDBMapper.java:622) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.ghx.aws.utils.services.dynamodb.AbstractDynamoDbSequenceGeneratorDAO.generateIncrementedValue(AbstractDynamoDbSequenceGeneratorDAO.java:69) [aws-utils-2.0.1.jar:na]
at com.ghx.aws.utils.services.dynamodb.AbstractDynamoDbSequenceGeneratorDAO.generateNextSequenceValue(AbstractDynamoDbSequenceGeneratorDAO.java:59) [aws-utils-2.0.1.jar:na]
at com.ghx.tpm.dao.impl.DynamoDbSequenceGeneratorDAO.generateNextValue(DynamoDbSequenceGeneratorDAO.java:41) [tpm-dao-mysql-2.1.0.jar:na]
at com.ghx.tpm.api.impl.SequenceGeneratorService.generateNextValue(SequenceGeneratorService.java:104) [tpm-api-2.1.0.jar:na]
at com.ghx.tpm.api.impl.SequenceGeneratorService.generateControlNumber(SequenceGeneratorService.java:46) [tpm-api-2.1.0.jar:na]
at com.ghx.tpm.api.impl.SequenceGeneratorService$$FastClassBySpringCGLIB$$55452f3c.invoke(<generated>) [tpm-api-2.1.0.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) [spring-core-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at com.ghx.tpm.api.impl.SequenceGeneratorService$$EnhancerBySpringCGLIB$$acd38f21.generateControlNumber(<generated>) [tpm-api-2.1.0.jar:na]
at com.ghx.tpm.api.impl.SequenceGeneratorService$$FastClassBySpringCGLIB$$55452f3c.invoke(<generated>) [tpm-api-2.1.0.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) [spring-core-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at com.ghx.tpm.api.impl.SequenceGeneratorService$$EnhancerBySpringCGLIB$$95bd6967.generateControlNumber(<generated>) [tpm-api-2.1.0.jar:na]
at com.ghx.rules.egx.action.setcontrolnumber.ControlNumberProvider.getControlNumber(ControlNumberProvider.java:9) [egx-actions-2.1.0.jar:na]
at com.ghx.rules.egx.action.setcontrolnumber.SetControlNumber.doPerform(SetControlNumber.java:163) [egx-actions-2.1.0.jar:na]
at com.ghx.rules.api.EGXCommonAction.perform(EGXCommonAction.java:86) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXAction.executeFromAction(EGXAction.java:126) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.action.CompositeAction.executeFromAction(CompositeAction.java:63) [rules-api-2.51.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.executeAction(EGXRuleExecutionSession.java:158) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.executeRuleFromAction(EGXRuleExecutionSession.java:126) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.executeRule(EGXRuleExecutionSession.java:185) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRule(EGXRuleExecutionSession.java:173) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRules(EGXRuleExecutionSession.java:87) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRules(EGXRuleExecutionSession.java:81) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.egx.engine.BaseFactAwareRuleEngine.executeRules(BaseFactAwareRuleEngine.java:31) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.service.RuleEngineProcessor.executeRulesAgainstEIDAndRuleType(RuleEngineProcessor.java:308) [rules-service-2.1.0.jar:na]
at com.ghx.rules.service.RuleEngineProcessor.fetchRulesAndExecute(RuleEngineProcessor.java:207) [rules-service-2.1.0.jar:na]
at com.ghx.rules.service.RuleEngineProcessor.executeEngines(RuleEngineProcessor.java:135) [rules-service-2.1.0.jar:na]
at com.ghx.rules.service.component.listener.DocumentExtractedEventBusListener.processEvent(DocumentExtractedEventBusListener.java:40) [rules-service-2.1.0.jar:na]
at com.ghx.rules.service.component.listener.DocumentExtractedEventBusListener.processEvent(DocumentExtractedEventBusListener.java:20) [rules-service-2.1.0.jar:na]
at com.ghx.eb.listener.AbstractEventListener.onEvent(AbstractEventListener.java:262) [eventbus-api-2.51.0.jar:na]
at com.ghx.eb.impl.dispatcher.AbstractListenerDispatcherThreadPool$RunnableDispatchEvent.run(AbstractListenerDispatcherThreadPool.java:222) [eventbus-impl-2.51.0.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_272]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_272]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_272]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_272]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_272]
message
c.g.a.u.s.d.AbstractDynamoDbSequenceGeneratorDAO - Failed saving of incremented sequence number
com.amazonaws.services.dynamodbv2.model.ConditionalCheckFailedException: The conditional request failed (Service: AmazonDynamoDBv2; Status Code: 400; Error Code: ConditionalCheckFailedException; Request ID: 67R3RE2C518GMC9H4FO42U27TNVV4KQNSO5AEMVJF66Q9ASUAAJG)
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.handleErrorResponse(AmazonHttpClient.java:1632) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeOneRequest(AmazonHttpClient.java:1304) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeHelper(AmazonHttpClient.java:1058) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.doExecute(AmazonHttpClient.java:743) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.executeWithTimer(AmazonHttpClient.java:717) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.execute(AmazonHttpClient.java:699) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutor.access$500(AmazonHttpClient.java:667) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient$RequestExecutionBuilderImpl.execute(AmazonHttpClient.java:649) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:513) ~[aws-java-sdk-core-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.doInvoke(AmazonDynamoDBClient.java:3452) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.invoke(AmazonDynamoDBClient.java:3428) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.executeUpdateItem(AmazonDynamoDBClient.java:3160) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.AmazonDynamoDBClient.updateItem(AmazonDynamoDBClient.java:3135) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper$SaveObjectHandler.doUpdateItem(DynamoDBMapper.java:853) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper$2.executeLowLevelRequest(DynamoDBMapper.java:593) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper$SaveObjectHandler.execute(DynamoDBMapper.java:732) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.amazonaws.services.dynamodbv2.datamodeling.DynamoDBMapper.save(DynamoDBMapper.java:622) ~[aws-java-sdk-dynamodb-1.11.327.jar:na]
at com.ghx.aws.utils.services.dynamodb.AbstractDynamoDbSequenceGeneratorDAO.generateIncrementedValue(AbstractDynamoDbSequenceGeneratorDAO.java:69) [aws-utils-2.0.1.jar:na]
at com.ghx.aws.utils.services.dynamodb.AbstractDynamoDbSequenceGeneratorDAO.generateNextSequenceValue(AbstractDynamoDbSequenceGeneratorDAO.java:59) [aws-utils-2.0.1.jar:na]
at com.ghx.tpm.dao.impl.DynamoDbSequenceGeneratorDAO.generateNextValue(DynamoDbSequenceGeneratorDAO.java:41) [tpm-dao-mysql-2.1.0.jar:na]
at com.ghx.tpm.api.impl.SequenceGeneratorService.generateNextValue(SequenceGeneratorService.java:104) [tpm-api-2.1.0.jar:na]
at com.ghx.tpm.api.impl.SequenceGeneratorService.generateControlNumber(SequenceGeneratorService.java:46) [tpm-api-2.1.0.jar:na]
at com.ghx.tpm.api.impl.SequenceGeneratorService$$FastClassBySpringCGLIB$$55452f3c.invoke(<generated>) [tpm-api-2.1.0.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) [spring-core-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at com.ghx.tpm.api.impl.SequenceGeneratorService$$EnhancerBySpringCGLIB$$acd38f21.generateControlNumber(<generated>) [tpm-api-2.1.0.jar:na]
at com.ghx.tpm.api.impl.SequenceGeneratorService$$FastClassBySpringCGLIB$$55452f3c.invoke(<generated>) [tpm-api-2.1.0.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204) [spring-core-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:738) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:282) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96) [spring-tx-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:673) [spring-aop-4.3.11.RELEASE.jar:4.3.11.RELEASE]
at com.ghx.tpm.api.impl.SequenceGeneratorService$$EnhancerBySpringCGLIB$$95bd6967.generateControlNumber(<generated>) [tpm-api-2.1.0.jar:na]
at com.ghx.rules.egx.action.setcontrolnumber.ControlNumberProvider.getControlNumber(ControlNumberProvider.java:9) [egx-actions-2.1.0.jar:na]
at com.ghx.rules.egx.action.setcontrolnumber.SetControlNumber.doPerform(SetControlNumber.java:163) [egx-actions-2.1.0.jar:na]
at com.ghx.rules.api.EGXCommonAction.perform(EGXCommonAction.java:86) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXAction.executeFromAction(EGXAction.java:126) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.action.CompositeAction.executeFromAction(CompositeAction.java:63) [rules-api-2.51.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.executeAction(EGXRuleExecutionSession.java:158) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.executeRuleFromAction(EGXRuleExecutionSession.java:126) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.executeRule(EGXRuleExecutionSession.java:185) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRule(EGXRuleExecutionSession.java:173) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRules(EGXRuleExecutionSession.java:87) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRules(EGXRuleExecutionSession.java:81) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.egx.engine.BaseFactAwareRuleEngine.executeRules(BaseFactAwareRuleEngine.java:31) [rules-egx-extn-2.1.0.jar:na]
at com.ghx.rules.service.RuleEngineProcessor.executeRulesAgainstEIDAndRuleType(RuleEngineProcessor.java:308) [rules-service-2.1.0.jar:na]
at com.ghx.rules.service.RuleEngineProcessor.fetchRulesAndExecute(RuleEngineProcessor.java:207) [rules-service-2.1.0.jar:na]
at com.ghx.rules.service.RuleEngineProcessor.executeEngines(RuleEngineProcessor.java:135) [rules-service-2.1.0.jar:na]
at com.ghx.rules.service.component.listener.DocumentExtractedEventBusListener.processEvent(DocumentExtractedEventBusListener.java:40) [rules-service-2.1.0.jar:na]
at com.ghx.rules.service.component.listener.DocumentExtractedEventBusListener.processEvent(DocumentExtractedEventBusListener.java:20) [rules-service-2.1.0.jar:na]
at com.ghx.eb.listener.AbstractEventListener.onEvent(AbstractEventListener.java:262) [eventbus-api-2.51.0.jar:na]
at com.ghx.eb.impl.dispatcher.AbstractListenerDispatcherThreadPool$RunnableDispatchEvent.run(AbstractListenerDispatcherThreadPool.java:222) [eventbus-impl-2.51.0.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_272]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_272]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_272]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_272]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_272]


Control number sequence generate

Dynamo DB slowness, little delay

df -h
ps -u tomcat

s3://appsupportint
s3://appsuppotfiles


error execution pre-cop

was modified by other mot

Flow restart processor

info warn debug
bus query unaasigned


Explorer service Transactions

System control- Engine IO - Adapter

Engnie component ->
Base property -> componenet ID





nce=null, preventErrors=true, highlightMerge=false, resultFields=null, sourceFields=null, searchType=null, alias=null, aliases=null, aliasRouting=null, addIndexMetaInfo=false, forceSearchOnIndex=null, forceSearchIndexes=null, aggregationOptions=null, aggregationOptionsList=null, collectTotalMatchCount=false, indicesOptions=null, queryName=[NOCOMP][NOMETHOD][Engine-PE][|NT-business_document_lines_all|], searchAfter=null, storeFields=null, excludeSourceFields=null, terminateAfter=0, trackTotalHits=true, trackTotalHitsUpto=null, responseConverterType=HASHMAP, collectSearchHits=true], Query - com.ghx.common.search.query.builder.ESSearchQueryBuilder@324526ad
2021-03-22 12:12:50,828 |DEBUG [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] c.g.common.search.engine.ESNativeRestTemplate - Started searching request for the given source as searchquerybuilder under index= [business_document_lines_all]
2021-03-22 12:12:50,894 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.searchengine.SearchEngineClientHelper - ESSearch [NOCOMP][NOMETHOD][Engine-PE][|NT-business_document_lines_all|], Total 0 records matched in 63ms, Query - {"bool":{"_name":"[NOCOMP][NOMETHOD][Engine-PE][|NT-business_document_lines_all|]","must":[{"terms":{"type":["INVOICE"]}},{"match":{"linePONumber.lowercase":"tc0137_3ng4s0smlxdk"}},{"term":{"withUnknownPO":true}}]}}
2021-03-22 12:12:50,903 |DEBUG [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] c.g.common.search.engine.ESNativeRestTemplate - Started execution of bulkindex for index= business_document_lines_2021_03
2021-03-22 12:12:50,912 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.searchengine.SearchEngineClientHelper - ESIndex from [NOCOMP][NOMETHOD][Engine-PE][bulkCreate] created, failure counts are 0
2021-03-22 12:12:50,912 |DEBUG [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] c.g.common.search.engine.ESNativeRestTemplate - Started execution of bulkindex for index= business_documents_2021_03
2021-03-22 12:12:50,919 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.searchengine.SearchEngineClientHelper - ESIndex from [NOCOMP][NOMETHOD][Engine-PE][bulkCreate] created, failure counts are 0
2021-03-22 12:12:50,919 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] c.g.b.service.impl.BusinessDocumentESService - &#x5b;1&#x5d; Business Documents indexed to [business_documents_2021_03] in 16 ms.
2021-03-22 12:12:50,919 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXCommonAction - Exiting BusinessTransactionAction action for document TRXebfdde85fc7f49aeb801fac6634f3144
2021-03-22 12:12:50,923 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXCommonAction - Performing BusinessDocumentReleaseAction action for document TRXebfdde85fc7f49aeb801fac6634f3144
2021-03-22 12:12:50,927 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] c.g.t.s.i.RelatedBusinessDocumentSequencingService - Removing Current BusinessDocument Id - 679812487253760, TrackingFlowId - TRXebfdde85fc7f49aeb801fac6634f3144 from RelatedBusinessDocuments collection, its Completed. Going to release next
2021-03-22 12:12:50,929 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] c.g.t.s.i.RelatedBusinessDocumentSequencingService - No more entries found, RelatedBusinessDocument with Id - 3441034_TC0137_3Ng4s0sMlXDk is deleted
2021-03-22 12:12:50,929 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXCommonAction - Exiting BusinessDocumentReleaseAction action for document TRXebfdde85fc7f49aeb801fac6634f3144
2021-03-22 12:12:50,941 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXCommonAction - Performing BusinessDocumentCompletedAction action for document TRXebfdde85fc7f49aeb801fac6634f3144
2021-03-22 12:12:50,944 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXCommonAction - Exiting BusinessDocumentCompletedAction action for document TRXebfdde85fc7f49aeb801fac6634f3144
2021-03-22 12:12:50,947 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXCommonAction - Performing SubflowCompleteAction action for document TRXebfdde85fc7f49aeb801fac6634f3144
2021-03-22 12:12:50,947 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXCommonAction - Exiting SubflowCompleteAction action for document TRXebfdde85fc7f49aeb801fac6634f3144
2021-03-22 12:12:50,954 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXCommonAction - Performing SubflowCorrelation action for document TRXebfdde85fc7f49aeb801fac6634f3144
2021-03-22 12:12:50,958 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXCommonAction - Exiting SubflowCorrelation action for document TRXebfdde85fc7f49aeb801fac6634f3144
2021-03-22 12:12:50,961 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXCommonAction - Performing AggregateBusinessRuleOrderStatistics action for document TRXebfdde85fc7f49aeb801fac6634f3144
2021-03-22 12:12:50,986 |INFO [GHX-BusDispatcherPool-INMEMORY-TRACKING.RULE_PROCESSOR_Bus_Listener-71-TRXebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXCommonAction - Exiting AggregateBusinessRuleOrderStatistics action for document TRXebfdde85fc7f49aeb801fac6634f3144
2021-03-22 12:12:51,002 |WARN [GHX-QueryPollerThread-EventBus_adapterResultListener_Bus_Listener-1] dev.morphia.query.FieldEndImpl - Specified an empty list/collection with the '_id' criteria
2021-03-22 12:12:51,002 |WARN [GHX-QueryPollerThread-EventBus_adapterResultListener_Bus_Listener-1] dev.morphia.mapping.Mapper - converted [] to null
2021-03-22 12:12:51,002 |ERROR [GHX-QueryPollerThread-EventBus_adapterResultListener_Bus_Listener-1] com.ghx.eb.data.dao.mongo.EventDAOImpl - BUS QUERY - UNASSIGN&#x3a; Query&#x3a;{"listenerPendingIds": "adapterResultListener", "sortingTs": {"$gte": {"$numberLong": "0"}}, "listenerHash": {"$gte": 0, "$lte": 99}, "consumableAfter": {"$lte": {"$numberLong": "1616415170992"}}} &#x9;Update&#x3a;{ {"$and": [{"listenerHash": {"$gte": 0}}, {"listenerHash": {"$lte": 99}}, {"_id": {"$in": []}}, {"listenerAssignedIds": {"$in": ["adapterResultListener"]}}]} , projection: {"_id": 1, "className": 1} } dev.morphia.query.UpdateOpsImpl@4216df58 
2021-03-22 12:12:51,016 |INFO [GHX-BusDispatcherPool-QUERY-adapterResultListener_Bus_Listener-280-42c7665125ac4d6aa1752fef0073bffc] c.g.p.component.AdapterResultEventBusListener - Scheduler for adapter 21511 will be shutdown because Success Count&#x3d;0 Fail Count&#x3d;1
2021-03-22 12:12:51,021 |INFO [GHX-BusDispatcherPool-QUERY-adapterResultListener_Bus_Listener-281-7b61f02067ef4c319238613ebc635ba3] c.g.p.component.AdapterResultEventBusListener - Scheduler for adapter 21511 will be shutdown because Success Count&#x3d;0 Fail Count&#x3d;1
2021-03-22 12:12:51,033 |INFO [GHX-BusDispatcherPool-QUERY-adapterResultListener_Bus_Listener-282-16480c31f8f04877ba722046ece2bb66] c.g.p.component.AdapterResultEventBusListener - Scheduler for adapter 21511 will be shutdown because Success Count&#x3d;0 Fail Count&#x3d;1
2021-03-22 12:12:51,060 |INFO [GHX-BusDispatcherPool-QUERY-adapterResultListener_Bus_Listener-283-1f930b5c544b46d6b755f5963f00f1da] c.g.p.component.AdapterResultEventBusListener - Scheduler for adapter 21511 will be shutdown because Success Count&#x3d;0 Fail Count&#x3d;1
2021-03-22 12:12:51,101 |INFO [GHX-BusDispatcherPool-QUERY-adapterResultListener_Bus_Listener-284-18087476f60e4cac8ae0508eb6944e1b] c.g.p.component.AdapterResultEventBusListener - Scheduler for adapter 21511 will be shutdown because Success Count&#x3d;0 Fail Count&#x3d;1
2021-03-22 12:12:51,106 |INFO [GHX-BusDispatcherPool-QUERY-adapterResultListener_Bus_Listener-285-e9bd32e8974244508ebe2efe9bac3824] c.g.p.component.AdapterResultEventBusListener - Scheduler for adapter 21511 will be shutdown because Success Count&#x3d;0 Fail Count&#x3d;1
2021-03-22 12:12:51,114 |INFO [GHX-BusDispatcherPool-QUERY-adapterResultListener_Bus_Listener-287-a3c6b60dfca242019bce53d695027c2e] c.g.p.component.AdapterResultEventBusListener - Scheduler for adapter 21511 will be shutdown because Success Count&#x3d;0 Fail Count&#x3d;1
2021-03-22 12:12:51,118 |INFO [GHX-BusDispatcherPool-QUERY-adapterResultListener_Bus_Listener-286-dee4f8aaaddb4f9cb8af961c92ba8eee] c.g.p.component.AdapterResultEventBusListener - Scheduler for adapter 21511 will be shutdown because Success Count&#x3d;0 Fail Count&#x3d;1
2021-03-22 12:12:51,184 |INFO [GHX-BusDispatcherPool-QUERY-adapterResultListener_Bus_Listener-288-5d8506b442324a2eb5744cf41c2f9972] c.g.p.component.AdapterResultEventBusListener - Scheduler for adapter 21511 will be shutdown because Success Count&#x3d;0 Fail Count&#x3d;1
2021-03-22 12:12:51,193 |INFO [GHX-BusDispatcherPool-QUERY-adapterResultListener_Bus_Listener-289-90d1e78b0fc54d8f8337d5f520bf8ae9] c.g.p.component.AdapterResultEventBusListener - Scheduler for adapter 21511 will be shutdown because Success Count&#x3d;0 Fail Count&#x3d;1
2021-03-22 12:12:51,602 |WARN [GHX-QueryPollerThread-EventBus_docMonitorListener_Bus_Listener-1] dev.morphia.query.FieldEndImpl - Specified an empty list/collection with the '_id' criteria
2021-03-22 12:12:51,602 |WARN [GHX-QueryPollerThread-EventBus_docMonitorListener_Bus_Listener-1] dev.morphia.mapping.Mapper - converted [] to null
2021-03-22 12:12:51,602 |ERROR [GHX-QueryPollerThread-EventBus_docMonitorListener_Bus_Listener-1] com.ghx.eb.data.dao.mongo.EventDAOImpl - BUS QUERY - UNASSIGN&#x3a; Query&#x3a;{"listenerPendingIds": {"$in": ["docMonitorListener"], "$nin": ["datapoller"]}, "sortingTs": {"$gte": {"$numberLong": "0"}}, "listenerHash": {"$gte": 0, "$lte": 99}, "consumableAfter": {"$lte": {"$numberLong": "1616415171573"}}, "listenerAssignedIds": {"$nin": ["datapoller"]}} &#x9;Update&#x3a;{ {"$and": [{"listenerHash": {"$gte": 0}}, {"listenerHash": {"$lte": 99}}, {"_id": {"$in": []}}, {"listenerAssignedIds": {"$in": ["docMonitorListener"]}}]} , projection: {"_id": 1, "className": 1} } dev.morphia.query.UpdateOpsImpl@c3ce154 
2021-03-22 12:12:51,627 |ERROR [GHX-BusDispatcherPool-QUERY-docMonitorListener_Bus_Listener-312-ebfdde85fc7f49aeb801fac6634f3144] com.ghx.rules.api.EGXRuleExecutionSession - Error executing Rule - 121792 Doc COntext, RuleType - COLLECTING ActionIndex - 0, 
com.google.common.cache.CacheLoader$InvalidCacheLoadException: CacheLoader returned null for key 121792.
at com.google.common.cache.LocalCache$Segment.getAndRecordStats(LocalCache.java:2455) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2417) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache.get(LocalCache.java:4147) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140) ~[guava-23.4-jre.jar:na]
at com.ghx.notification.service.MonitorTriggerCacheServiceImpl.getMonitorTriggerId(MonitorTriggerCacheServiceImpl.java:114) ~[notification-impl-2.2.0-SNAPSHOT.jar:na]
at com.ghx.notification.service.MonitorTriggerCacheServiceImpl.getSelectedOrganizationsByRuleId(MonitorTriggerCacheServiceImpl.java:127) ~[notification-impl-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.egx.specification.NotificationSelectedOrgsSpecification.findSelectedNotificationPartnerIds(NotificationSelectedOrgsSpecification.java:71) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.egx.specification.NotificationSelectedOrgsSpecification.isSatisfiedBy(NotificationSelectedOrgsSpecification.java:55) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.egx.specification.NotificationSelectedOrgsSpecification.isSatisfiedBy(NotificationSelectedOrgsSpecification.java:24) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.api.specification.logical.AndSpecification.isSatisfiedBy(AndSpecification.java:52) ~[rules-api-2.51.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.executeRuleFromAction(EGXRuleExecutionSession.java:104) [rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.executeRule(EGXRuleExecutionSession.java:185) [rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRule(EGXRuleExecutionSession.java:173) [rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRules(EGXRuleExecutionSession.java:87) [rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRules(EGXRuleExecutionSession.java:81) [rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.egx.engine.BaseFactAwareRuleEngine.executeRules(BaseFactAwareRuleEngine.java:31) [rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.docmonitor.DocMonitorAgent.handle(DocMonitorAgent.java:79) [doc-monitor-scheduler-2.2.0-SNAPSHOT.jar:na]
at com.ghx.docmonitor.DocMonitorListener.processEvent(DocMonitorListener.java:35) [doc-monitor-scheduler-2.2.0-SNAPSHOT.jar:na]
at com.ghx.docmonitor.DocMonitorListener.processEvent(DocMonitorListener.java:22) [doc-monitor-scheduler-2.2.0-SNAPSHOT.jar:na]
at com.ghx.eb.listener.AbstractEventListener.onEvent(AbstractEventListener.java:262) [eventbus-api-2.51.0.jar:na]
at com.ghx.eb.impl.dispatcher.AbstractListenerDispatcherThreadPool$RunnableDispatchEvent.run(AbstractListenerDispatcherThreadPool.java:222) [eventbus-impl-2.51.0.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_272]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_272]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_272]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_272]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_272]
2021-03-22 12:12:51,627 |ERROR [GHX-BusDispatcherPool-QUERY-docMonitorListener_Bus_Listener-312-ebfdde85fc7f49aeb801fac6634f3144] com.ghx.docmonitor.DocMonitorAgent - Error occurred during COLLECTING Rule Engine execution of rule &#x3a; 121792, com.google.common.cache.CacheLoader$InvalidCacheLoadException: CacheLoader returned null for key 121792.
com.ghx.rules.api.exception.RuleExecutionException: com.google.common.cache.CacheLoader$InvalidCacheLoadException: CacheLoader returned null for key 121792.
at com.ghx.rules.api.EGXRuleExecutionSession.fireRule(EGXRuleExecutionSession.java:180) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRules(EGXRuleExecutionSession.java:87) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRules(EGXRuleExecutionSession.java:81) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.egx.engine.BaseFactAwareRuleEngine.executeRules(BaseFactAwareRuleEngine.java:31) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.docmonitor.DocMonitorAgent.handle(DocMonitorAgent.java:79) ~[doc-monitor-scheduler-2.2.0-SNAPSHOT.jar:na]
at com.ghx.docmonitor.DocMonitorListener.processEvent(DocMonitorListener.java:35) [doc-monitor-scheduler-2.2.0-SNAPSHOT.jar:na]
at com.ghx.docmonitor.DocMonitorListener.processEvent(DocMonitorListener.java:22) [doc-monitor-scheduler-2.2.0-SNAPSHOT.jar:na]
at com.ghx.eb.listener.AbstractEventListener.onEvent(AbstractEventListener.java:262) [eventbus-api-2.51.0.jar:na]
at com.ghx.eb.impl.dispatcher.AbstractListenerDispatcherThreadPool$RunnableDispatchEvent.run(AbstractListenerDispatcherThreadPool.java:222) [eventbus-impl-2.51.0.jar:na]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [na:1.8.0_272]
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [na:1.8.0_272]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) [na:1.8.0_272]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) [na:1.8.0_272]
at java.lang.Thread.run(Thread.java:748) [na:1.8.0_272]
Caused by: com.google.common.cache.CacheLoader$InvalidCacheLoadException: CacheLoader returned null for key 121792.
at com.google.common.cache.LocalCache$Segment.getAndRecordStats(LocalCache.java:2455) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2417) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2299) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2212) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache.get(LocalCache.java:4147) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache.getOrLoad(LocalCache.java:4151) ~[guava-23.4-jre.jar:na]
at com.google.common.cache.LocalCache$LocalLoadingCache.get(LocalCache.java:5140) ~[guava-23.4-jre.jar:na]
at com.ghx.notification.service.MonitorTriggerCacheServiceImpl.getMonitorTriggerId(MonitorTriggerCacheServiceImpl.java:114) ~[notification-impl-2.2.0-SNAPSHOT.jar:na]
at com.ghx.notification.service.MonitorTriggerCacheServiceImpl.getSelectedOrganizationsByRuleId(MonitorTriggerCacheServiceImpl.java:127) ~[notification-impl-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.egx.specification.NotificationSelectedOrgsSpecification.findSelectedNotificationPartnerIds(NotificationSelectedOrgsSpecification.java:71) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.egx.specification.NotificationSelectedOrgsSpecification.isSatisfiedBy(NotificationSelectedOrgsSpecification.java:55) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.egx.specification.NotificationSelectedOrgsSpecification.isSatisfiedBy(NotificationSelectedOrgsSpecification.java:24) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.api.specification.logical.AndSpecification.isSatisfiedBy(AndSpecification.java:52) ~[rules-api-2.51.0.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.executeRuleFromAction(EGXRuleExecutionSession.java:104) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.executeRule(EGXRuleExecutionSession.java:185) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
at com.ghx.rules.api.EGXRuleExecutionSession.fireRule(EGXRuleExecutionSession.java:173) ~[rules-egx-extn-2.2.0-SNAPSHOT.jar:na]
... 13 common frames omitted
2021-03-22 12:12:52,429 |INFO [EGXLocal-EBUS_SCHEDULER_Worker-4] com.ghx.eb.impl.rebalance.ListenerRebalancer - 
Listener CACHE:Local : SLA_RELEASE:i-0044a31d9c5531a78,  SYS_MONITOR:i-0044a31d9c5531a78,  SLA_APPLY:i-0044a31d9c5531a78,  LEGACY_DOC_CORRELATOR:i-0044a31d9c5531a78,  channelUtilization:i-0044a31d9c5531a78,  LEGACY_AUDIT.AU:i-0044a31d9c5531a78,  asEventListener:i-0044a31d9c5531a78,  TRIGGERS:i-0044a31d9c5531a78,  auditRelationshipAuditAlertSentListener:i-0044a31d9c5531a78,  delayed_execution_event_redirector:i-0044a31d9c5531a78,  TICKET_EMAIL_PARSER:i-0044a31d9c5531a78,  RULES.DE:i-0044a31d9c5531a78,  adapterResultListener:i-0044a31d9c5531a78,  DREV.ASFR:i-0044a31d9c5531a78,  DREV.FR:i-0044a31d9c5531a78,  DREV.CEMR:i-0044a31d9c5531a78,  RULES.RELEASE_PARKED_DOCUMENT:i-0044a31d9c5531a78,  ScheduledMaintenanceExpiry:i-0044a31d9c5531a78,  RELATIONSHIP_VALIDATOR.CDR:i-0044a31d9c5531a78,  ENRICHMEN


#!/bin/bash -x

copyScripts () {
    mongo_ds_dir=$1

    mkdir -p "mongoscripts/${mongo_ds_dir}"

    mongo_ds_release_dir="${mongo_ds_dir}/release"
    mongo_ds_release_version_dir="${mongo_ds_release_dir}/$2"
    echo "Processing mongo scripts for ${mongo_ds_dir} from location ${mongo_ds_release_version_dir}"

    if [ -d "${mongo_ds_release_version_dir}" ]
    then
        echo "SUCCESS: Directory ${mongo_ds_release_version_dir} exists."
    else
        echo "WARN: Directory ${mongo_ds_release_version_dir} does not exists. Trying to find latest version that might exist in directory to upload."
        minor_version=`ls ${mongo_ds_release_dir}| grep "^$3" | awk -F'_' '{ print $2 }' | sort -n | tail -1` 
        echo "ls ${mongo_ds_release_dir}| grep "^$3" | awk -F'_' '{ print $2 }' | sort -n | tail -1"
        echo "minor version is ${minor_version}"
        mongo_ds_release_version_dir="${mongo_ds_release_dir}/$3_${minor_version}_0"
        echo "mongo_ds_release_version_dir is ${mongo_ds_release_version_dir}"
    fi

    echo "COPYING: file from ${mongo_ds_release_version_dir}"
    cp -a ${mongo_ds_release_version_dir}/. ./mongoscripts/${mongo_ds_dir}/
    #cp ${mongo_ds_release_version_dir}/runall*.js ./mongoscripts/${mongo_ds_dir}/runall.js
}

copyCustomScripts () {
    mkdir -p "mongoscripts/custom_update"    
    #echo "COPYING: js files from test-framework/test-framework-api/release/*.js to mongoscripts"
    find test-framework/test-framework-api/release/util/custom_updates/ -maxdepth 1 -type f -name "*.js" | xargs -i cp {} ./mongoscripts/custom_update/
}

egxbranchname=${bamboo.planRepository.branchName}
egxversion=${bamboo.EGX_Version}    
echo $egxversion
egx_version=$(echo $egxversion | sed 's/\./\_/g')
egx_version="v$egx_version"
echo "current version is $egx_version"

#major_version=`ls | grep "^v"| awk -F'_' '{ print $1 }' | sort | tail -1`
#echo "deduced major version is ${major_version}"
major_version=`echo ${egx_version} | awk -F'_' '{ print $1 }'`
echo "Major version from ${egx_version} is ${major_version}"

copyScripts 'event-broker-ds' ${egx_version} ${major_version}

copyScripts 'audit-ds' ${egx_version} ${major_version}

copyScripts 'statistics-ds' ${egx_version} ${major_version}

copyScripts 'audit-relationship-ds' ${egx_version} ${major_version}

copyScripts 'partner-service-monitoring' ${egx_version} ${major_version}

copyScripts 'configsvc/configsvc-api' ${egx_version} ${major_version}

copyScripts 'archive-ds' ${egx_version} ${major_version}

copyScripts 'test-framework/test-framework-api' ${egx_version} ${major_version}

copyScripts 'notification-framework/notification-ds' ${egx_version} ${major_version}

copyScripts 'business-transaction-ds' ${egx_version} ${major_version}

copyScripts 'eventbus/eventbus-api' ${egx_version} ${major_version}

copyCustomScripts

echo "Finished"



mongoscripts/*




#!/bin/bash -x

copyScripts () {
    mongo_ds_dir=$1

    mkdir -p "mongoscripts/${mongo_ds_dir}"

    mongo_ds_release_dir="${mongo_ds_dir}"
    mongo_ds_release_version_dir="${mongo_ds_release_dir}"
    echo "Processing mongo scripts for ${mongo_ds_dir} from location ${mongo_ds_release_version_dir}"

    if [ -d "${mongo_ds_release_version_dir}" ]
    then
        echo "SUCCESS: Directory ${mongo_ds_release_version_dir} exists."
    else
        echo "WARN: Directory ${mongo_ds_release_version_dir} does not exists. Trying to find latest version that might exist in directory to upload."
        minor_version=`ls ${mongo_ds_release_dir}| grep "^$3" | awk -F'_' '{ print $2 }' | sort -n | tail -1` 
        echo "ls ${mongo_ds_release_dir}| grep "^$3" | awk -F'_' '{ print $2 }' | sort -n | tail -1"
        echo "minor version is ${minor_version}"
        mongo_ds_release_version_dir="${mongo_ds_release_dir}/$3_${minor_version}_0"
        echo "mongo_ds_release_version_dir is ${mongo_ds_release_version_dir}"
    fi

    echo "COPYING: file from ${mongo_ds_release_version_dir}"
    cp -a ${mongo_ds_release_version_dir}/. ./mongoscripts/${mongo_ds_dir}/
    #cp ${mongo_ds_release_version_dir}/runall*.js ./mongoscripts/${mongo_ds_dir}/runall.js
}

copyCustomScripts () {
    mkdir -p "mongoscripts/custom_update"    
    #echo "COPYING: js files from test-framework/test-framework-api/release/*.js to mongoscripts"
    find test-framework/test-framework-api/release/util/custom_updates/ -maxdepth 1 -type f -name "*.js" | xargs -i cp {} ./mongoscripts/custom_update/
}

egxbranchname=${bamboo.planRepository.branchName}
egxversion=${bamboo.EGX_Version}    
echo $egxversion
egx_version=$(echo $egxversion | sed 's/\./\_/g')
egx_version="v$egx_version"
echo "current version is $egx_version"

#major_version=`ls | grep "^v"| awk -F'_' '{ print $1 }' | sort | tail -1`
#echo "deduced major version is ${major_version}"
major_version=`echo ${egx_version} | awk -F'_' '{ print $1 }'`
echo "Major version from ${egx_version} is ${major_version}"

copyScripts 'event-broker-ds' ${egx_version} ${major_version}

copyScripts 'audit-ds' ${egx_version} ${major_version}

copyScripts 'statistics-ds' ${egx_version} ${major_version}

copyScripts 'audit-relationship-ds' ${egx_version} ${major_version}

copyScripts 'partner-service-monitoring' ${egx_version} ${major_version}

copyScripts 'configsvc' ${egx_version} ${major_version}

copyScripts 'archive-ds' ${egx_version} ${major_version}

copyScripts 'test-framework/test-framework-api' ${egx_version} ${major_version}

copyScripts 'notification-framework' ${egx_version} ${major_version}

copyScripts 'business-transaction-ds' ${egx_version} ${major_version}

copyScripts 'eventbus/eventbus-api' ${egx_version} ${major_version}

copyCustomScripts

echo "Finished"

BUILD FAILURE IN BAMBOO:

ls: cannot access event-broker-ds/release: No such file or directory

cp: cannot stat ‘event-broker-ds/release/v2__0/.’: No such file or directory

cp: cannot stat ‘audit-ds/release/v2__0/.’: No such file or directory

cp: cannot stat ‘statistics-ds/release/v2__0/.’: No such file or directory

cp: cannot stat ‘audit-relationship-ds/release/v2__0/.’: No such file or directory

cp: cannot stat ‘partner-service-monitoring/release/v2__0/.’: No such file or directory

ls: cannot access configsvc/configsvc-api/release: No such file or directory

cp: cannot stat ‘configsvc/configsvc-api/release/v2__0/.’: No such file or directory


cp: cannot stat ‘archive-ds/release/v2__0/.’: No such file or directory


cp: cannot stat ‘test-framework/test-framework-api/release/v2__0/.’: No such file or directory

ls: cannot access notification-framework/notification-ds/release: No such file or directory

cp: cannot stat ‘notification-framework/notification-ds/release/v2__0/.’: No such file or directory


cp: cannot stat ‘business-transaction-ds/release/v2__0/.’: No such file or directory


cp: cannot stat ‘eventbus/eventbus-api/release/v2__0/.’: No such file or directory
22-Jan-2021 05:29:12 find: ‘test-framework/test-framework-api/release/util/custom_updates/’: No such file or directory


event-broker-ds

audit-ds

statistics-ds

audit-relationship-ds

partner-service-monitoring

configsvc

archive-ds

notification-framework

business-transaction-ds

 we need to provide the current s3 location for fetching all copying mongo db


CLOUD MONGO NEWRELIC QUERY:

SELECT opcounters.queryPerSecond from MongoConfigServerSample where label.mongoCluster IN ('event-bus-stg-sharded-cluster')

SELECT operation.scanAndOrderPerSecond from MongoConfigServerSample where label.mongoCluster IN ('event-bus-stg-sharded-cluster')

SELECT average(operation.scanAndOrderPerSecond) FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster = 'rs12-s1' FACET displayName TIMESERIES

SELECT operation.scanAndOrderPerSecond FROM MongoConfigServerSample where label.mongoCluster IN ('event-bus-stg-sharded-cluster')


SELECT average(operation.scanAndOrderPerSecond) FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster IN('event-bus-stg-sharded-cluster','rs12-s1')

SELECT average(operation.scanAndOrderPerSecond) FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster IN('event-bus-stg-sharded-cluster','rs11-s2')

SELECT average(operation.scanAndOrderPerSecond) FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster = 'rs12-s1' SINCE '2021-02-09 08:52:46' UNTIL '2021-02-09 09:10:46' FACET displayName TIMESERIES

https://insights-api.newrelic.com/v1/accounts/1550954/query?nrql=SELECT operation.scanAndOrderPerSecond, FROM MongoConfigServerSample where label.mongoCluster IN ('%25event-bus-dev-sharded-cluster%25' AND ' SINCE '2021-01-28 17:24:46' UNTIL '2021-01-28 17:25:46' FACET entityName,label.service

https://insights-api.newrelic.com/v1/accounts/1550954/query?nrql=SELECT operation.scanAndOrderPerSecond FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster IN('event-bus-stg-sharded-cluster','rs12-s2') AND ' SINCE '2021-01-28 17:24:46' UNTIL '2021-01-28 17:25:46' FACET entityName,label.service


"""nrql_scan_and_order_es_url = newrelic_api_insight_url + "query?nrql=" \
            "SELECT operation.scanAndOrderPerSecond, " \
            "FROM MongoConfigServerSample " \
            "where label.mongoCluster IN ('" + entity_name + "' AND " \
            "' SINCE '" + nrql_past + "' UNTIL '" + nrql_future + "' FACET " \
            "entityName,label.service""""

SELECT operation.scanAndOrderPerSecond FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster IN('event-bus-stg-sharded-cluster','rs11-s2') SINCE '2021-01-29 12:12:46' UNTIL '2021-01-29 12:13:46'

SELECT average(operation.scanAndOrderPerSecond) FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster IN('event-bus-stg-sharded-cluster','rs12-s1') SINCE '2021-01-29 12:20:50' UNTIL '2021-01-29 12:21:50'


SELECT average(operation.scanAndOrderPerSecond) FROM MongoConfigServerSample where label.mongoCluster IN ('%25event-bus-stg-sharded-cluster%25','rs12-s2')  SINCE '2021-01-29 12:32:02' UNTIL '2021-01-29 12:33:02'

sys-user@SMI-518:~/selvapriya_pc_BackUp/aws$ curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/stg-cloudmongo-scanandorder_all/_search?pretty=true"
{
  "took" : 11,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 10000,
      "relation" : "gte"
    },
    "max_score" : 1.0,
    "hits" : [
      {
        "_index" : "stg-cloudmongo-scanandorder",
        "_type" : "_doc",
        "_id" : "vrsvMHMBr8xB2vtPeBYt",
        "_score" : 1.0,
        "_source" : {
          "replicaset" : "rs12-s1",
          "clusterName" : "event-bus-stg-sharded-cluster",
          "@timestamp" : "2020-07-08T20:47:10Z",
          "value" : 0,
          "measurement_type" : "OPERATIONS_SCAN_AND_ORDER",
          "granularity" : "PT10S",
          "ipwithhostname" : "10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com"
        }
      },
      {
        "_index" : "stg-cloudmongo-scanandorder",
        "_type" : "_doc",
        "_id" : "uLsvMHMBr8xB2vtPeBYt",
        "_score" : 1.0,
        "_source" : {
          "replicaset" : "rs12-s1",
          "clusterName" : "event-bus-stg-sharded-cluster",
          "@timestamp" : "2020-07-08T20:47:04Z",
          "value" : 0,
          "measurement_type" : "OPERATIONS_SCAN_AND_ORDER",
          "granularity" : "PT10S",
          "ipwithhostname" : "10.31.34.104-CoreX-STG-db-eb-s1-04.awsdsi.ghx.com"
        }
      },
      {
        "_index" : "stg-cloudmongo-scanandorder",
        "_type" : "_doc",
        "_id" : "trsvMHMBr8xB2vtPeBYt",
        "_score" : 1.0,
        "_source" : {
          "replicaset" : "rs12-s1",
          "clusterName" : "event-bus-stg-sharded-cluster",
          "@timestamp" : "2020-07-08T20:46:44Z",
          "value" : 0,
          "measurement_type" : "OPERATIONS_SCAN_AND_ORDER",
          "granularity" : "PT10S",
          "ipwithhostname" : "10.31.34.104-CoreX-STG-db-eb-s1-04.awsdsi.ghx.com"
        }
      },
      {
        "_index" : "stg-cloudmongo-scanandorder",
        "_type" : "_doc",
        "_id" : "tLsvMHMBr8xB2vtPeBYt",
        "_score" : 1.0,
        "_source" : {
          "replicaset" : "rs12-s1",
          "clusterName" : "event-bus-stg-sharded-cluster",
          "@timestamp" : "2020-07-08T20:46:24Z",
          "value" : 0,
          "measurement_type" : "OPERATIONS_SCAN_AND_ORDER",
          "granularity" : "PT10S",
          "ipwithhostname" : "10.31.34.104-CoreX-STG-db-eb-s1-04.awsdsi.ghx.com"
        }
      },
      {
        "_index" : "stg-cloudmongo-scanandorder",
        "_type" : "_doc",
        "_id" : "U-EvMHMBLO5KL0ZodUX3",
        "_score" : 1.0,
        "_source" : {
          "replicaset" : "rs12-s2",
          "clusterName" : "event-bus-stg-sharded-cluster",
          "@timestamp" : "2020-07-08T20:47:52Z",
          "value" : 0,
          "measurement_type" : "OPERATIONS_SCAN_AND_ORDER",
          "granularity" : "PT10S",
          "ipwithhostname" : "10.31.34.242-CoreX-STG-db-eb-s2-02.awsdsi.ghx.com"
        }
      },
      {
        "_index" : "stg-cloudmongo-scanandorder",
        "_type" : "_doc",
        "_id" : "UuEvMHMBLO5KL0ZodUX3",
        "_score" : 1.0,
        "_source" : {
          "replicaset" : "rs12-s2",
          "clusterName" : "event-bus-stg-sharded-cluster",
          "@timestamp" : "2020-07-08T20:47:42Z",
          "value" : 0,
          "measurement_type" : "OPERATIONS_SCAN_AND_ORDER",
          "granularity" : "PT10S",
          "ipwithhostname" : "10.31.34.242-CoreX-STG-db-eb-s2-02.awsdsi.ghx.com"
        }
      },
      {
        "_index" : "stg-cloudmongo-scanandorder",
        "_type" : "_doc",
        "_id" : "UOEvMHMBLO5KL0ZodUX3",
        "_score" : 1.0,
        "_source" : {
          "replicaset" : "rs12-s2",
          "clusterName" : "event-bus-stg-sharded-cluster",
          "@timestamp" : "2020-07-08T20:47:22Z",
          "value" : 0,
          "measurement_type" : "OPERATIONS_SCAN_AND_ORDER",
          "granularity" : "PT10S",
          "ipwithhostname" : "10.31.34.242-CoreX-STG-db-eb-s2-02.awsdsi.ghx.com"
        }
      },
      {
        "_index" : "stg-cloudmongo-scanandorder",
        "_type" : "_doc",
        "_id" : "TOEvMHMBLO5KL0ZodUX3",
        "_score" : 1.0,
        "_source" : {
          "replicaset" : "rs12-s2",
          "clusterName" : "event-bus-stg-sharded-cluster",
          "@timestamp" : "2020-07-08T20:47:25Z",
          "value" : 0,
          "measurement_type" : "OPERATIONS_SCAN_AND_ORDER",
          "granularity" : "PT10S",
          "ipwithhostname" : "10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com"
        }
      },
      {
        "_index" : "stg-cloudmongo-scanandorder",
        "_type" : "_doc",
        "_id" : "Q-EvMHMBLO5KL0ZodUX3",
        "_score" : 1.0,
        "_source" : {
          "replicaset" : "rs12-s1",
          "clusterName" : "event-bus-stg-sharded-cluster",
          "@timestamp" : "2020-07-08T20:47:30Z",
          "value" : 0,
          "measurement_type" : "OPERATIONS_SCAN_AND_ORDER",
          "granularity" : "PT10S",
          "ipwithhostname" : "10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com"
        }
      },
      {
        "_index" : "stg-cloudmongo-scanandorder",
        "_type" : "_doc",
        "_id" : "QOEvMHMBLO5KL0ZodUX3",
        "_score" : 1.0,
        "_source" : {
          "replicaset" : "rs12-s1",
          "clusterName" : "event-bus-stg-sharded-cluster",
          "@timestamp" : "2020-07-08T20:47:04Z",
          "value" : 0,
          "measurement_type" : "OPERATIONS_SCAN_AND_ORDER",
          "granularity" : "PT10S",
          "ipwithhostname" : "10.31.37.131-CoreX-STG-db-eb-s1-03.awsdsi.ghx.com"
        }
      }
    ]
  }
}


{"data":[{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602777540000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10001000016927719,"time":1602777600000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.09995002299547195,"time":1602777720000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602777780000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602777840000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602777900000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.09999000281095505,"time":1602777960000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.09999000281095505,"time":1602778020000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10001000016927719,"time":1602778080000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602778140000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602778200000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10001000016927719,"time":1602778260000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10019036382436752,"time":1602778320000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602778380000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602778440000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602778500000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602778560000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602778620000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602778680000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602778740000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602778860000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.0995718389749527,"time":1602778920000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602778980000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10001000016927719,"time":1602779040000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.09999000281095505,"time":1602779100000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602779220000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10001000016927719,"time":1602779280000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602779340000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602779400000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602779460000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.09999000281095505,"time":1602779580000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602779640000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602779700000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.09998000413179398,"time":1602779760000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602779820000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602779940000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780000000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780060000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10003001242876053,"time":1602780120000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780180000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.09999000281095505,"time":1602780300000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780360000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780420000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780480000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780540000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780660000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780720000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780780000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780840000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602780900000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602781020000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.09999000281095505,"time":1602781080000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602781140000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.09999000281095505,"time":1602781200000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602781260000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602781380000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.09999000281095505,"time":1602781440000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602781500000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602781560000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602781620000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602781740000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602781800000},{"10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1":0.10000000149011612,"time":1602781860000}],"keys":["10.31.33.114-CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1"],"groupByItems":{"rs12-s1":"rs12-s1","rs12-s2":"rs12-s2"}}


{"data":[{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602777540000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602777600000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602777720000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602777780000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602777840000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602777900000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602777960000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602778020000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602778140000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602778200000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602778260000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602778320000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602778380000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602778500000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602778560000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602778620000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602778680000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602778740000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602778860000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602778920000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602778980000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602779040000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602779100000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.0999700054526329,"time":1602779220000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602779280000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602779340000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602779400000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602779460000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602779580000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602779640000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602779700000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602779760000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602779820000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602779940000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602780000000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602780060000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602780120000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602780180000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602780300000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602780360000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602780420000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602780480000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602780540000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602780660000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602780720000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602780780000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10002000629901886,"time":1602780840000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602780900000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602781020000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602781080000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602781140000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10019036382436752,"time":1602781200000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09996001422405243,"time":1602781260000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09984025359153748,"time":1602781380000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602781440000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602781500000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602781560000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602781620000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602781680000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602781740000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.09999000281095505,"time":1602781800000},{"10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2":0.10000000149011612,"time":1602781860000}],"keys":["10.31.33.230-CoreX-STG-db-eb-s2-01.awsdsi.ghx.com-rs12-s2"],"groupByItems":{"rs12-s1":"rs12-s1","rs12-s2":"rs12-s2"}}





'''
Created on 28-Jan-2021

@author: sys-user
'''
#!/usr/bin/python
"""
collects cpu and db connection metric for TPM details and push to ES
"""
import logging
import time
import json
import re
from datetime import datetime, timedelta
import boto3
import requests
from requests import get
from requests.utils import quote
from elasticsearch import Elasticsearch, helpers

def load_config(configobj, cfile):
    """load configuration details"""
    f = open(cfile, 'r')
    for line in f:
        line = line.strip()
        (param, value) = re.split(':', line, maxsplit=1)
        configobj[param] = value
    f.close()
    return configobj

# end load_config

def set_subdomain(metaobj):
    """set sub domain details"""
    if metaobj['accountId'] == "050190852521":
        subd = 'awsdsi.ghx.com'
    else:
        subd = 'awsprd.ghx.com'
    return subd

dateTag = datetime.now().strftime("%Y-%b-%d")
LOG_FILENAME = '/var/log/tpmmetric/EventBusnewrelicmetriccollection.log_%s.log'
logging.basicConfig(filename=LOG_FILENAME % dateTag, level=logging.INFO)
logging.info('Started')

configuration = {}
load_config(configuration, '/opt/conf/cf-params.txt')

meta = json.loads(get('http://169.254.169.254/latest/dynamic/instance-identity/document/').content)
instance_id = meta['instanceId']
hostname = meta['privateIp']

subdomain = set_subdomain(meta)

es = Elasticsearch(['https://' + meta['region'] + '-testframework-es.' + subdomain ] , verify_certs=False)

cw = boto3.resource('ec2', region_name=meta['region'])
total_exec_time = 0
env = configuration['GHXEnvironment'].lower()

newrelic_api_insight_url = configuration['NewrelicApiInsightUrl']
newrelic_query_key = configuration['NewrelicQueryKey']

while True:
    try:
        cloudmongoscanandorders = []
        cloudmongooscanandOrderRs12s1 = {}
        cloudmongooscanandOrderRs12s2 = {}

        scan_and_order_indexname = env + '-newrelic-' + 'scan-and-order-utilization'
        opcounter_indexname = env + '-newrelic-' + 'opcounter-query-utilization'
        exec_starttime = datetime.utcnow()
        now = datetime.utcnow()
        pasttime = (now - timedelta(minutes=2)).strftime("%Y-%m-%dT%H:%M:%S")
        currenttime = (now - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:%S")
        past = (now - timedelta(minutes=13)).strftime("%Y-%m-%dT%H:%M:%S") + "+00:00"
        nrql_past = (now - timedelta(minutes=13)).strftime("%Y-%m-%d %H:%M:%S")
        nrql_future = (now - timedelta(minutes=12)).strftime("%Y-%m-%d %H:%M:%S")
        entity_name = quote("%event-bus-" + 'stg' + "-sharded-cluster%")
        entity_name_not_like = quote("%repl%")
        print(currenttime)
        print(pasttime)
        nrql_scan_and_order_rs12_s1_es_url = newrelic_api_insight_url + "query?nrql=" \
            "SELECT average(operation.scanAndOrderPerSecond) " \
            "FROM MongodSample " \
            "where label.mongoCluster IN ('" + entity_name + "','rs12-s1') " \
            " SINCE '" + pasttime + "' UNTIL '" + currenttime + "'"
        nrql_scan_and_order_rs12_s2_es_url = newrelic_api_insight_url + "query?nrql=" \
            "SELECT average(operation.scanAndOrderPerSecond) " \
            "FROM MongodSample " \
            "where label.mongoCluster IN ('" + entity_name + "','rs12-s2') " \
            " SINCE '" + pasttime + "' UNTIL '" + currenttime + "'"
#nrql_scan_and_order_es_url = "https://insights-api.newrelic.com/v1/accounts/1550954/query?nrql=SELECT operation.scanAndOrderPerSecond FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster IN('event-bus-stg-sharded-cluster','rs11-s2')"
        print(nrql_scan_and_order_rs12_s1_es_url)
        print(nrql_scan_and_order_rs12_s2_es_url)
        nrql_scan_and_order_rs12_s1_es_results = requests.get(nrql_scan_and_order_rs12_s1_es_url,
                                           headers={"X-Query-Key" : newrelic_query_key,
                                                    "Accept": "application/json"})
        print(nrql_scan_and_order_rs12_s1_es_results)
        nrql_scan_and_order_rs12_s1_es_results_json = nrql_scan_and_order_rs12_s1_es_results.json()
        print(nrql_scan_and_order_rs12_s1_es_results_json)
        
        nrql_scan_and_order_rs12_s2_es_results = requests.get(nrql_scan_and_order_rs12_s2_es_url,
                                           headers={"X-Query-Key" : newrelic_query_key,
                                                    "Accept": "application/json"})
        print(nrql_scan_and_order_rs12_s2_es_results)
        nrql_scan_and_order_rs12_s2_es_results_json = nrql_scan_and_order_rs12_s2_es_results.json()
        print(nrql_scan_and_order_rs12_s2_es_results_json)

        print(nrql_scan_and_order_es_results_json['results'][0]['average'])
        cloudmongooscanandOrderRs12s1 = {
        'ipwithhostname': 'CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s1',
        'clusterName': 'event-bus-' + environment \
                                    + '-sharded-cluster',
        'replicaset': 'rs12-s1',
        'measurement_type': 'OPERATIONS_SCAN_AND_ORDER',
        'value': nrql_scan_and_order_rs12_s1_es_results_json['results'][0]['average'],
        '@timestamp': now+'Z',
        }
        logging.info(cloudmongooscanandOrderRs12s1)
        cloudmongooscanandOrderRs12s2 = {
        'ipwithhostname': 'CoreX-STG-db-eb-s1-01.awsdsi.ghx.com-rs12-s2',
        'clusterName': 'event-bus-' + environment \
                                    + '-sharded-cluster',
        'replicaset': 'rs12-s2',
        'measurement_type': 'OPERATIONS_SCAN_AND_ORDER',
        'value': nrql_scan_and_order_rs12_s2_es_results_json['results'][0]['average'],
        '@timestamp': now+'Z',
        }
        logging.info(cloudmongooscanandOrderRs12s2)

        indexname = environment + '-cloudmongo-scanandorder'

        Rs12s1data_dict = {'_op_type': 'index',
            '_index': indexname,
            '_source': cloudmongooscanandOrderRs12s1}
        logging.info(Rs12s1data_dict)
        Rs12s2data_dict = {'_op_type': 'index',
            '_index': indexname,
            '_source': cloudmongooscanandOrderRs12s2}
        logging.info(Rs12s2data_dict)

        cloudmongoscanandorders.append(Rs12s1data_dict)
        cloudmongoscanandorders.append(Rs12s2data_dict)
        print(cloudmongoscanandorders)
        try:
            print("before es bulk indexing")
            helpers.bulk(client=es, actions=cloudmongoscanandorders)
            print("after es bulk indexing")
        except Exception as ex:
            logging.exception(ex)
            es.indices.refresh()
            cloudmongoscanandorders = []
            exec_endtime = datetime.utcnow()
            total_exec_time = abs(exec_endtime-exec_starttime).seconds
    except Exception as ex:
        logging.exception("message")
    finally:
        time.sleep(59)
logging.info('End')



sys-user@SMI-518:~/selvapriya_pc_BackUp/aws$ curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/stg-cloudmongo-scanandorder_all/_search?pretty" -H 'Content-Type: application/json' -d'
{"query":{"bool":{"must":{"match_all":{}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"gte":"2021-01-29T19:58:43Z","lte":"2021-01-29T19:59:43Z"}}}],
"must_not":[]}}}}}'
{
  "took" : 82,
  "timed_out" : false,
  "_shards" : {
    "total" : 5,
    "successful" : 5,
    "skipped" : 0,
    "failed" : 0
  },
  "hits" : {
    "total" : {
      "value" : 0,
      "relation" : "eq"
    },
    "max_score" : null,
    "hits" : [ ]
  }
}




curl -X GET "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d'
{
    "query": {
        "range" : {
            "timestamp" : {
                "gte": "2015-01-01 00:00:00", 
                "lte": "now", 
                "time_zone": "+01:00"
            }
        }
    }
}

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-cloudmongo-scanandorder_all/_search?pretty=true

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-cloudmongo-scanandorder_all/_search?pretty" -H 'Content-Type: application/json' -d'
{"query":{"bool":{"must":{"match_all":{}},"filter":{"bool":{"must":[{"range":{"@timestamp":{"gte":"2019-11-05T12:53:10.039Z","lte":"2019-11-05T12:54:18.039Z"}}}],
"must_not":[]}}}}}'

2021-01-29T18:03:58' UNTIL '2021-01-29T18:04:58'





SELECT average(opcounters.commandPerSecond) AS 'command', average(opcounters.getmorePerSecond) AS 'getMore', average(opcounters.deletePerSecond) AS 'delete', average(opcounters.updatePerSecond) AS 'update', average(opcounters.queryPerSecond) AS 'query', average(opcounters.insertPerSecond) AS 'insert' FROM MongodSample WHERE label.mongoCluster = 'rs12-s2' SINCE '2021-01-28 17:24:46' UNTIL '2021-01-28 17:25:46' FACET displayName TIMESERIES

Since 28 Jan 22:54 IST until 28 Jan 22:55 IST
{
  "facets": [
    {
      "name": "CoreX-STG-db-eb-s2-01.awsdsi.ghx.com:27027",
      "total": {
        "results": [
          {
            "average": 23.96180534362793
          },
          {
            "average": 5.9673611124356585
          },
          {
            "average": 0.09895833767950535
          },
          {
            "average": 12.379166543483734
          },
          {
            "average": 31.022222359975178
          },
          {
            "average": 2.159027802447478
          }
        ],
        "beginTimeSeconds": 1611854686,
        "endTimeSeconds": 1611854746,
        "inspectedCount": 12
      },
      "timeSeries": [
        {
          "results": [
            {
              "average": 23.933332443237305
            },
            {
              "average": 5.5333333015441895
            },
            {
              "average": 0.13333334028720856
            },
            {
              "average": 4.866666793823242
            },
            {
              "average": 36.13333511352539
            },
            {
              "average": 1.9333332777023315
            }
          ],
          "beginTimeSeconds": 1611854686,
          "endTimeSeconds": 1611854688,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854688,
          "endTimeSeconds": 1611854690,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 31.43333339691162
            },
            {
              "average": 8.600000381469727
            },
            {
              "average": 0.06666667014360428
            },
            {
              "average": 18.133333206176758
            },
            {
              "average": 33.53333282470703
            },
            {
              "average": 3.4666666984558105
            }
          ],
          "beginTimeSeconds": 1611854690,
          "endTimeSeconds": 1611854692,
          "inspectedCount": 2
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854692,
          "endTimeSeconds": 1611854694,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854694,
          "endTimeSeconds": 1611854696,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854696,
          "endTimeSeconds": 1611854698,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854698,
          "endTimeSeconds": 1611854700,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854700,
          "endTimeSeconds": 1611854702,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 37.400001525878906
            },
            {
              "average": 12.333333015441895
            },
            {
              "average": 0.06666667014360428
            },
            {
              "average": 27.600000381469727
            },
            {
              "average": 22.133333206176758
            },
            {
              "average": 6.133333206176758
            }
          ],
          "beginTimeSeconds": 1611854702,
          "endTimeSeconds": 1611854704,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854704,
          "endTimeSeconds": 1611854706,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 30.433332443237305
            },
            {
              "average": 10.233333110809326
            },
            {
              "average": 0.13333334028720856
            },
            {
              "average": 20.66666603088379
            },
            {
              "average": 21.799999237060547
            },
            {
              "average": 4.800000190734863
            }
          ],
          "beginTimeSeconds": 1611854706,
          "endTimeSeconds": 1611854708,
          "inspectedCount": 2
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854708,
          "endTimeSeconds": 1611854710,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854710,
          "endTimeSeconds": 1611854712,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854712,
          "endTimeSeconds": 1611854714,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854714,
          "endTimeSeconds": 1611854716,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 21.266666412353516
            },
            {
              "average": 3.5999999046325684
            },
            {
              "average": 0.13333334028720856
            },
            {
              "average": 9.199999809265137
            },
            {
              "average": 34.53333282470703
            },
            {
              "average": 0.20000000298023224
            }
          ],
          "beginTimeSeconds": 1611854716,
          "endTimeSeconds": 1611854718,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854718,
          "endTimeSeconds": 1611854720,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 18.66666603088379
            },
            {
              "average": 3.066666603088379
            },
            {
              "average": 0.06666667014360428
            },
            {
              "average": 3.799999952316284
            },
            {
              "average": 38.93333435058594
            },
            {
              "average": 0.2666666805744171
            }
          ],
          "beginTimeSeconds": 1611854720,
          "endTimeSeconds": 1611854722,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": 17.5625
            },
            {
              "average": 2.875
            },
            {
              "average": 0.0625
            },
            {
              "average": 3.625
            },
            {
              "average": 34.75
            },
            {
              "average": 0.25
            }
          ],
          "beginTimeSeconds": 1611854722,
          "endTimeSeconds": 1611854724,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854724,
          "endTimeSeconds": 1611854726,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854726,
          "endTimeSeconds": 1611854728,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854728,
          "endTimeSeconds": 1611854730,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854730,
          "endTimeSeconds": 1611854732,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 15.399999618530273
            },
            {
              "average": 2.4000000953674316
            },
            {
              "average": 0.06666667014360428
            },
            {
              "average": 7.199999809265137
            },
            {
              "average": 34.66666793823242
            },
            {
              "average": 0.3333333432674408
            }
          ],
          "beginTimeSeconds": 1611854732,
          "endTimeSeconds": 1611854734,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854734,
          "endTimeSeconds": 1611854736,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 14.789583206176758
            },
            {
              "average": 2.0666667222976685
            },
            {
              "average": 0.12916667014360428
            },
            {
              "average": 7.329166650772095
            },
            {
              "average": 30.225000381469727
            },
            {
              "average": 0.12916667014360428
            }
          ],
          "beginTimeSeconds": 1611854736,
          "endTimeSeconds": 1611854738,
          "inspectedCount": 2
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854738,
          "endTimeSeconds": 1611854740,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854740,
          "endTimeSeconds": 1611854742,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854742,
          "endTimeSeconds": 1611854744,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854744,
          "endTimeSeconds": 1611854746,
          "inspectedCount": 0
        }
      ]
    },
    {
      "name": "CoreX-STG-db-eb-s2-02.awsdsi.ghx.com:27027",
      "total": {
        "results": [
          {
            "average": 17.920486370722454
          },
          {
            "average": 5.9888888994852705
          },
          {
            "average": 0
          },
          {
            "average": 0
          },
          {
            "average": 0
          },
          {
            "average": 0
          }
        ],
        "beginTimeSeconds": 1611854686,
        "endTimeSeconds": 1611854746,
        "inspectedCount": 12
      },
      "timeSeries": [
        {
          "results": [
            {
              "average": 17.53333282470703
            },
            {
              "average": 5.5333333015441895
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854686,
          "endTimeSeconds": 1611854688,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854688,
          "endTimeSeconds": 1611854690,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 21.33333396911621
            },
            {
              "average": 8.600000381469727
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854690,
          "endTimeSeconds": 1611854692,
          "inspectedCount": 2
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854692,
          "endTimeSeconds": 1611854694,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854694,
          "endTimeSeconds": 1611854696,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854696,
          "endTimeSeconds": 1611854698,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854698,
          "endTimeSeconds": 1611854700,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854700,
          "endTimeSeconds": 1611854702,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 23.600000381469727
            },
            {
              "average": 12.066666603088379
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854702,
          "endTimeSeconds": 1611854704,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854704,
          "endTimeSeconds": 1611854706,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 24.133334159851074
            },
            {
              "average": 10.299999713897705
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854706,
          "endTimeSeconds": 1611854708,
          "inspectedCount": 2
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854708,
          "endTimeSeconds": 1611854710,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854710,
          "endTimeSeconds": 1611854712,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854712,
          "endTimeSeconds": 1611854714,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854714,
          "endTimeSeconds": 1611854716,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 15.933333396911621
            },
            {
              "average": 3.5999999046325684
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854716,
          "endTimeSeconds": 1611854718,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854718,
          "endTimeSeconds": 1611854720,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 14.866666793823242
            },
            {
              "average": 3.133333444595337
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854720,
          "endTimeSeconds": 1611854722,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": 14.0625
            },
            {
              "average": 2.9375
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854722,
          "endTimeSeconds": 1611854724,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854724,
          "endTimeSeconds": 1611854726,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854726,
          "endTimeSeconds": 1611854728,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854728,
          "endTimeSeconds": 1611854730,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854730,
          "endTimeSeconds": 1611854732,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 12.933333396911621
            },
            {
              "average": 2.5333333015441895
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854732,
          "endTimeSeconds": 1611854734,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854734,
          "endTimeSeconds": 1611854736,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 12.59166669845581
            },
            {
              "average": 2.131250023841858
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854736,
          "endTimeSeconds": 1611854738,
          "inspectedCount": 2
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854738,
          "endTimeSeconds": 1611854740,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854740,
          "endTimeSeconds": 1611854742,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854742,
          "endTimeSeconds": 1611854744,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854744,
          "endTimeSeconds": 1611854746,
          "inspectedCount": 0
        }
      ]
    },
    {
      "name": "CoreX-STG-db-eb-s2-03.awsdsi.ghx.com:27027",
      "total": {
        "results": [
          {
            "average": 11.580902814865112
          },
          {
            "average": 0.329861119389534
          },
          {
            "average": 0
          },
          {
            "average": 0
          },
          {
            "average": 0
          },
          {
            "average": 0
          }
        ],
        "beginTimeSeconds": 1611854686,
        "endTimeSeconds": 1611854746,
        "inspectedCount": 12
      },
      "timeSeries": [
        {
          "results": [
            {
              "average": 12.133333206176758
            },
            {
              "average": 0.3333333432674408
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854686,
          "endTimeSeconds": 1611854688,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854688,
          "endTimeSeconds": 1611854690,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 12.833333492279053
            },
            {
              "average": 0.3333333432674408
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854690,
          "endTimeSeconds": 1611854692,
          "inspectedCount": 2
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854692,
          "endTimeSeconds": 1611854694,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854694,
          "endTimeSeconds": 1611854696,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854696,
          "endTimeSeconds": 1611854698,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854698,
          "endTimeSeconds": 1611854700,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854700,
          "endTimeSeconds": 1611854702,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 11.600000381469727
            },
            {
              "average": 0.3333333432674408
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854702,
          "endTimeSeconds": 1611854704,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854704,
          "endTimeSeconds": 1611854706,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 11.166666507720947
            },
            {
              "average": 0.3333333432674408
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854706,
          "endTimeSeconds": 1611854708,
          "inspectedCount": 2
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854708,
          "endTimeSeconds": 1611854710,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854710,
          "endTimeSeconds": 1611854712,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854712,
          "endTimeSeconds": 1611854714,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854714,
          "endTimeSeconds": 1611854716,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 12.133333206176758
            },
            {
              "average": 0.3333333432674408
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854716,
          "endTimeSeconds": 1611854718,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854718,
          "endTimeSeconds": 1611854720,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 11.666666984558105
            },
            {
              "average": 0.3333333432674408
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854720,
          "endTimeSeconds": 1611854722,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": 10.9375
            },
            {
              "average": 0.3125
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854722,
          "endTimeSeconds": 1611854724,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854724,
          "endTimeSeconds": 1611854726,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854726,
          "endTimeSeconds": 1611854728,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854728,
          "endTimeSeconds": 1611854730,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854730,
          "endTimeSeconds": 1611854732,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 10.800000190734863
            },
            {
              "average": 0.3333333432674408
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854732,
          "endTimeSeconds": 1611854734,
          "inspectedCount": 1
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854734,
          "endTimeSeconds": 1611854736,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": 10.849999904632568
            },
            {
              "average": 0.3229166716337204
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            },
            {
              "average": 0
            }
          ],
          "beginTimeSeconds": 1611854736,
          "endTimeSeconds": 1611854738,
          "inspectedCount": 2
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854738,
          "endTimeSeconds": 1611854740,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854740,
          "endTimeSeconds": 1611854742,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854742,
          "endTimeSeconds": 1611854744,
          "inspectedCount": 0
        },
        {
          "results": [
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            },
            {
              "average": null
            }
          ],
          "beginTimeSeconds": 1611854744,
          "endTimeSeconds": 1611854746,
          "inspectedCount": 0
        }
      ]
    }
  ],
  "totalResult": {
    "total": {
      "results": [
        {
          "average": 17.82106484307183
        },
        {
          "average": 4.095370377103488
        },
        {
          "average": 0.032986112559835114
        },
        {
          "average": 4.126388847827911
        },
        {
          "average": 10.340740786658394
        },
        {
          "average": 0.7196759341491593
        }
      ],
      "beginTimeSeconds": 1611854686,
      "endTimeSeconds": 1611854746,
      "inspectedCount": 36
    },
    "timeSeries": [
      {
        "results": [
          {
            "average": 17.866666158040363
          },
          {
            "average": 3.7999999821186066
          },
          {
            "average": 0.044444446762402855
          },
          {
            "average": 1.6222222646077473
          },
          {
            "average": 12.044445037841797
          },
          {
            "average": 0.6444444259007772
          }
        ],
        "beginTimeSeconds": 1611854686,
        "endTimeSeconds": 1611854688,
        "inspectedCount": 3
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854688,
        "endTimeSeconds": 1611854690,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": 21.866666952768963
          },
          {
            "average": 5.844444702068965
          },
          {
            "average": 0.022222223381201427
          },
          {
            "average": 6.044444402058919
          },
          {
            "average": 11.177777608235678
          },
          {
            "average": 1.1555555661519368
          }
        ],
        "beginTimeSeconds": 1611854690,
        "endTimeSeconds": 1611854692,
        "inspectedCount": 6
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854692,
        "endTimeSeconds": 1611854694,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854694,
        "endTimeSeconds": 1611854696,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854696,
        "endTimeSeconds": 1611854698,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854698,
        "endTimeSeconds": 1611854700,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854700,
        "endTimeSeconds": 1611854702,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": 24.200000762939453
          },
          {
            "average": 8.244444320599237
          },
          {
            "average": 0.022222223381201427
          },
          {
            "average": 9.200000127156576
          },
          {
            "average": 7.377777735392253
          },
          {
            "average": 2.0444444020589194
          }
        ],
        "beginTimeSeconds": 1611854702,
        "endTimeSeconds": 1611854704,
        "inspectedCount": 3
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854704,
        "endTimeSeconds": 1611854706,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": 21.911111036936443
          },
          {
            "average": 6.955555389324824
          },
          {
            "average": 0.044444446762402855
          },
          {
            "average": 6.888888676961263
          },
          {
            "average": 7.266666412353516
          },
          {
            "average": 1.6000000635782878
          }
        ],
        "beginTimeSeconds": 1611854706,
        "endTimeSeconds": 1611854708,
        "inspectedCount": 6
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854708,
        "endTimeSeconds": 1611854710,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854710,
        "endTimeSeconds": 1611854712,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854712,
        "endTimeSeconds": 1611854714,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854714,
        "endTimeSeconds": 1611854716,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": 16.444444338480633
          },
          {
            "average": 2.5111110508441925
          },
          {
            "average": 0.044444446762402855
          },
          {
            "average": 3.066666603088379
          },
          {
            "average": 11.51111094156901
          },
          {
            "average": 0.06666666766007741
          }
        ],
        "beginTimeSeconds": 1611854716,
        "endTimeSeconds": 1611854718,
        "inspectedCount": 3
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854718,
        "endTimeSeconds": 1611854720,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": 15.066666603088379
          },
          {
            "average": 2.177777796983719
          },
          {
            "average": 0.022222223381201427
          },
          {
            "average": 1.2666666507720947
          },
          {
            "average": 12.977778116861979
          },
          {
            "average": 0.08888889352480571
          }
        ],
        "beginTimeSeconds": 1611854720,
        "endTimeSeconds": 1611854722,
        "inspectedCount": 3
      },
      {
        "results": [
          {
            "average": 14.1875
          },
          {
            "average": 2.0416666666666665
          },
          {
            "average": 0.020833333333333332
          },
          {
            "average": 1.2083333333333333
          },
          {
            "average": 11.583333333333334
          },
          {
            "average": 0.08333333333333333
          }
        ],
        "beginTimeSeconds": 1611854722,
        "endTimeSeconds": 1611854724,
        "inspectedCount": 3
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854724,
        "endTimeSeconds": 1611854726,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854726,
        "endTimeSeconds": 1611854728,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854728,
        "endTimeSeconds": 1611854730,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854730,
        "endTimeSeconds": 1611854732,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": 13.04444440205892
          },
          {
            "average": 1.7555555800596874
          },
          {
            "average": 0.022222223381201427
          },
          {
            "average": 2.3999999364217124
          },
          {
            "average": 11.555555979410807
          },
          {
            "average": 0.11111111442248027
          }
        ],
        "beginTimeSeconds": 1611854732,
        "endTimeSeconds": 1611854734,
        "inspectedCount": 3
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854734,
        "endTimeSeconds": 1611854736,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": 12.743749936421713
          },
          {
            "average": 1.5069444725910823
          },
          {
            "average": 0.04305555671453476
          },
          {
            "average": 2.4430555502573648
          },
          {
            "average": 10.075000127156576
          },
          {
            "average": 0.04305555671453476
          }
        ],
        "beginTimeSeconds": 1611854736,
        "endTimeSeconds": 1611854738,
        "inspectedCount": 6
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854738,
        "endTimeSeconds": 1611854740,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854740,
        "endTimeSeconds": 1611854742,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854742,
        "endTimeSeconds": 1611854744,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854744,
        "endTimeSeconds": 1611854746,
        "inspectedCount": 0
      }
    ]
  },
  "unknownGroup": {
    "total": {
      "results": [
        {
          "average": null
        },
        {
          "average": null
        },
        {
          "average": null
        },
        {
          "average": null
        },
        {
          "average": null
        },
        {
          "average": null
        }
      ],
      "beginTimeSeconds": 1611854686,
      "endTimeSeconds": 1611854746,
      "inspectedCount": 0
    },
    "timeSeries": [
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854686,
        "endTimeSeconds": 1611854688,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854688,
        "endTimeSeconds": 1611854690,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854690,
        "endTimeSeconds": 1611854692,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854692,
        "endTimeSeconds": 1611854694,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854694,
        "endTimeSeconds": 1611854696,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854696,
        "endTimeSeconds": 1611854698,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854698,
        "endTimeSeconds": 1611854700,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854700,
        "endTimeSeconds": 1611854702,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854702,
        "endTimeSeconds": 1611854704,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854704,
        "endTimeSeconds": 1611854706,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854706,
        "endTimeSeconds": 1611854708,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854708,
        "endTimeSeconds": 1611854710,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854710,
        "endTimeSeconds": 1611854712,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854712,
        "endTimeSeconds": 1611854714,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854714,
        "endTimeSeconds": 1611854716,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854716,
        "endTimeSeconds": 1611854718,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854718,
        "endTimeSeconds": 1611854720,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854720,
        "endTimeSeconds": 1611854722,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854722,
        "endTimeSeconds": 1611854724,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854724,
        "endTimeSeconds": 1611854726,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854726,
        "endTimeSeconds": 1611854728,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854728,
        "endTimeSeconds": 1611854730,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854730,
        "endTimeSeconds": 1611854732,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854732,
        "endTimeSeconds": 1611854734,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854734,
        "endTimeSeconds": 1611854736,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854736,
        "endTimeSeconds": 1611854738,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854738,
        "endTimeSeconds": 1611854740,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854740,
        "endTimeSeconds": 1611854742,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854742,
        "endTimeSeconds": 1611854744,
        "inspectedCount": 0
      },
      {
        "results": [
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          },
          {
            "average": null
          }
        ],
        "beginTimeSeconds": 1611854744,
        "endTimeSeconds": 1611854746,
        "inspectedCount": 0
      }
    ]
  },
  "metadata": {
    "eventTypes": [
      "MongodSample"
    ],
    "eventType": "MongodSample",
    "openEnded": false,
    "beginTime": "2021-01-28T17:24:46Z",
    "endTime": "2021-01-28T17:25:46Z",
    "beginTimeMillis": 1611854686000,
    "endTimeMillis": 1611854746000,
    "rawSince": "'2021-01-28 17:24:46'",
    "rawUntil": "'2021-01-28 17:25:46'",
    "rawCompareWith": "",
    "bucketSizeMillis": 2000,
    "facetExpression": "`displayName`",
    "guid": "2aa5d012-3b1b-055a-8a4a-ce8d6d07bcf6",
    "routerGuid": "f1ef4c88-a789-63bc-4989-ca3a363c5fa1",
    "messages": [],
    "facet": "displayName",
    "offset": 0,
    "limit": 10,
    "contents": {
      "messages": [],
      "timeSeries": {
        "messages": [],
        "contents": [
          {
            "function": "alias",
            "alias": "command",
            "contents": {
              "function": "average",
              "attribute": "opcounters.commandPerSecond",
              "simple": true
            }
          },
          {
            "function": "alias",
            "alias": "getMore",
            "contents": {
              "function": "average",
              "attribute": "opcounters.getmorePerSecond",
              "simple": true
            }
          },
          {
            "function": "alias",
            "alias": "delete",
            "contents": {
              "function": "average",
              "attribute": "opcounters.deletePerSecond",
              "simple": true
            }
          },
          {
            "function": "alias",
            "alias": "update",
            "contents": {
              "function": "average",
              "attribute": "opcounters.updatePerSecond",
              "simple": true
            }
          },
          {
            "function": "alias",
            "alias": "query",
            "contents": {
              "function": "average",
              "attribute": "opcounters.queryPerSecond",
              "simple": true
            }
          },
          {
            "function": "alias",
            "alias": "insert",
            "contents": {
              "function": "average",
              "attribute": "opcounters.insertPerSecond",
              "simple": true
            }
          }
        ]
      }
    }
  }
}





SELECT average(operation.scanAndOrderPerSecond) FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster = 'rs12-s2' SINCE '2021-01-28 17:24:46' UNTIL '2021-01-28 17:25:46'FACET displayName TIMESERIES


{"facets":[{"name":"CoreX-STG-db-eb-s2-01.awsdsi.ghx.com:27027","total":{"results":[{"average":0.01666666753590107}],"beginTimeSeconds":1611854686,"endTimeSeconds":1611854746,"inspectedCount":12},"timeSeries":[{"results":[{"average":0}],"beginTimeSeconds":1611854686,"endTimeSeconds":1611854688,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854688,"endTimeSeconds":1611854690,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854690,"endTimeSeconds":1611854692,"inspectedCount":2},{"results":[{"average":null}],"beginTimeSeconds":1611854692,"endTimeSeconds":1611854694,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854694,"endTimeSeconds":1611854696,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854696,"endTimeSeconds":1611854698,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854698,"endTimeSeconds":1611854700,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854700,"endTimeSeconds":1611854702,"inspectedCount":0},{"results":[{"average":0.06666667014360428}],"beginTimeSeconds":1611854702,"endTimeSeconds":1611854704,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854704,"endTimeSeconds":1611854706,"inspectedCount":0},{"results":[{"average":0.06666667014360428}],"beginTimeSeconds":1611854706,"endTimeSeconds":1611854708,"inspectedCount":2},{"results":[{"average":null}],"beginTimeSeconds":1611854708,"endTimeSeconds":1611854710,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854710,"endTimeSeconds":1611854712,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854712,"endTimeSeconds":1611854714,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854714,"endTimeSeconds":1611854716,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854716,"endTimeSeconds":1611854718,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854718,"endTimeSeconds":1611854720,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854720,"endTimeSeconds":1611854722,"inspectedCount":1},{"results":[{"average":0}],"beginTimeSeconds":1611854722,"endTimeSeconds":1611854724,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854724,"endTimeSeconds":1611854726,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854726,"endTimeSeconds":1611854728,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854728,"endTimeSeconds":1611854730,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854730,"endTimeSeconds":1611854732,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854732,"endTimeSeconds":1611854734,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854734,"endTimeSeconds":1611854736,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854736,"endTimeSeconds":1611854738,"inspectedCount":2},{"results":[{"average":null}],"beginTimeSeconds":1611854738,"endTimeSeconds":1611854740,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854740,"endTimeSeconds":1611854742,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854742,"endTimeSeconds":1611854744,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854744,"endTimeSeconds":1611854746,"inspectedCount":0}]},{"name":"CoreX-STG-db-eb-s2-02.awsdsi.ghx.com:27027","total":{"results":[{"average":0}],"beginTimeSeconds":1611854686,"endTimeSeconds":1611854746,"inspectedCount":12},"timeSeries":[{"results":[{"average":0}],"beginTimeSeconds":1611854686,"endTimeSeconds":1611854688,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854688,"endTimeSeconds":1611854690,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854690,"endTimeSeconds":1611854692,"inspectedCount":2},{"results":[{"average":null}],"beginTimeSeconds":1611854692,"endTimeSeconds":1611854694,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854694,"endTimeSeconds":1611854696,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854696,"endTimeSeconds":1611854698,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854698,"endTimeSeconds":1611854700,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854700,"endTimeSeconds":1611854702,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854702,"endTimeSeconds":1611854704,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854704,"endTimeSeconds":1611854706,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854706,"endTimeSeconds":1611854708,"inspectedCount":2},{"results":[{"average":null}],"beginTimeSeconds":1611854708,"endTimeSeconds":1611854710,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854710,"endTimeSeconds":1611854712,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854712,"endTimeSeconds":1611854714,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854714,"endTimeSeconds":1611854716,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854716,"endTimeSeconds":1611854718,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854718,"endTimeSeconds":1611854720,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854720,"endTimeSeconds":1611854722,"inspectedCount":1},{"results":[{"average":0}],"beginTimeSeconds":1611854722,"endTimeSeconds":1611854724,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854724,"endTimeSeconds":1611854726,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854726,"endTimeSeconds":1611854728,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854728,"endTimeSeconds":1611854730,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854730,"endTimeSeconds":1611854732,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854732,"endTimeSeconds":1611854734,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854734,"endTimeSeconds":1611854736,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854736,"endTimeSeconds":1611854738,"inspectedCount":2},{"results":[{"average":null}],"beginTimeSeconds":1611854738,"endTimeSeconds":1611854740,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854740,"endTimeSeconds":1611854742,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854742,"endTimeSeconds":1611854744,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854744,"endTimeSeconds":1611854746,"inspectedCount":0}]},{"name":"CoreX-STG-db-eb-s2-03.awsdsi.ghx.com:27027","total":{"results":[{"average":0}],"beginTimeSeconds":1611854686,"endTimeSeconds":1611854746,"inspectedCount":12},"timeSeries":[{"results":[{"average":0}],"beginTimeSeconds":1611854686,"endTimeSeconds":1611854688,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854688,"endTimeSeconds":1611854690,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854690,"endTimeSeconds":1611854692,"inspectedCount":2},{"results":[{"average":null}],"beginTimeSeconds":1611854692,"endTimeSeconds":1611854694,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854694,"endTimeSeconds":1611854696,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854696,"endTimeSeconds":1611854698,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854698,"endTimeSeconds":1611854700,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854700,"endTimeSeconds":1611854702,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854702,"endTimeSeconds":1611854704,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854704,"endTimeSeconds":1611854706,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854706,"endTimeSeconds":1611854708,"inspectedCount":2},{"results":[{"average":null}],"beginTimeSeconds":1611854708,"endTimeSeconds":1611854710,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854710,"endTimeSeconds":1611854712,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854712,"endTimeSeconds":1611854714,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854714,"endTimeSeconds":1611854716,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854716,"endTimeSeconds":1611854718,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854718,"endTimeSeconds":1611854720,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854720,"endTimeSeconds":1611854722,"inspectedCount":1},{"results":[{"average":0}],"beginTimeSeconds":1611854722,"endTimeSeconds":1611854724,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854724,"endTimeSeconds":1611854726,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854726,"endTimeSeconds":1611854728,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854728,"endTimeSeconds":1611854730,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854730,"endTimeSeconds":1611854732,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854732,"endTimeSeconds":1611854734,"inspectedCount":1},{"results":[{"average":null}],"beginTimeSeconds":1611854734,"endTimeSeconds":1611854736,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854736,"endTimeSeconds":1611854738,"inspectedCount":2},{"results":[{"average":null}],"beginTimeSeconds":1611854738,"endTimeSeconds":1611854740,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854740,"endTimeSeconds":1611854742,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854742,"endTimeSeconds":1611854744,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854744,"endTimeSeconds":1611854746,"inspectedCount":0}]}],"totalResult":{"total":{"results":[{"average":0.005555555845300357}],"beginTimeSeconds":1611854686,"endTimeSeconds":1611854746,"inspectedCount":36},"timeSeries":[{"results":[{"average":0}],"beginTimeSeconds":1611854686,"endTimeSeconds":1611854688,"inspectedCount":3},{"results":[{"average":null}],"beginTimeSeconds":1611854688,"endTimeSeconds":1611854690,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854690,"endTimeSeconds":1611854692,"inspectedCount":6},{"results":[{"average":null}],"beginTimeSeconds":1611854692,"endTimeSeconds":1611854694,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854694,"endTimeSeconds":1611854696,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854696,"endTimeSeconds":1611854698,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854698,"endTimeSeconds":1611854700,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854700,"endTimeSeconds":1611854702,"inspectedCount":0},{"results":[{"average":0.022222223381201427}],"beginTimeSeconds":1611854702,"endTimeSeconds":1611854704,"inspectedCount":3},{"results":[{"average":null}],"beginTimeSeconds":1611854704,"endTimeSeconds":1611854706,"inspectedCount":0},{"results":[{"average":0.022222223381201427}],"beginTimeSeconds":1611854706,"endTimeSeconds":1611854708,"inspectedCount":6},{"results":[{"average":null}],"beginTimeSeconds":1611854708,"endTimeSeconds":1611854710,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854710,"endTimeSeconds":1611854712,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854712,"endTimeSeconds":1611854714,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854714,"endTimeSeconds":1611854716,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854716,"endTimeSeconds":1611854718,"inspectedCount":3},{"results":[{"average":null}],"beginTimeSeconds":1611854718,"endTimeSeconds":1611854720,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854720,"endTimeSeconds":1611854722,"inspectedCount":3},{"results":[{"average":0}],"beginTimeSeconds":1611854722,"endTimeSeconds":1611854724,"inspectedCount":3},{"results":[{"average":null}],"beginTimeSeconds":1611854724,"endTimeSeconds":1611854726,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854726,"endTimeSeconds":1611854728,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854728,"endTimeSeconds":1611854730,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854730,"endTimeSeconds":1611854732,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854732,"endTimeSeconds":1611854734,"inspectedCount":3},{"results":[{"average":null}],"beginTimeSeconds":1611854734,"endTimeSeconds":1611854736,"inspectedCount":0},{"results":[{"average":0}],"beginTimeSeconds":1611854736,"endTimeSeconds":1611854738,"inspectedCount":6},{"results":[{"average":null}],"beginTimeSeconds":1611854738,"endTimeSeconds":1611854740,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854740,"endTimeSeconds":1611854742,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854742,"endTimeSeconds":1611854744,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854744,"endTimeSeconds":1611854746,"inspectedCount":0}]},"unknownGroup":{"total":{"results":[{"average":null}],"beginTimeSeconds":1611854686,"endTimeSeconds":1611854746,"inspectedCount":0},"timeSeries":[{"results":[{"average":null}],"beginTimeSeconds":1611854686,"endTimeSeconds":1611854688,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854688,"endTimeSeconds":1611854690,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854690,"endTimeSeconds":1611854692,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854692,"endTimeSeconds":1611854694,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854694,"endTimeSeconds":1611854696,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854696,"endTimeSeconds":1611854698,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854698,"endTimeSeconds":1611854700,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854700,"endTimeSeconds":1611854702,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854702,"endTimeSeconds":1611854704,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854704,"endTimeSeconds":1611854706,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854706,"endTimeSeconds":1611854708,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854708,"endTimeSeconds":1611854710,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854710,"endTimeSeconds":1611854712,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854712,"endTimeSeconds":1611854714,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854714,"endTimeSeconds":1611854716,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854716,"endTimeSeconds":1611854718,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854718,"endTimeSeconds":1611854720,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854720,"endTimeSeconds":1611854722,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854722,"endTimeSeconds":1611854724,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854724,"endTimeSeconds":1611854726,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854726,"endTimeSeconds":1611854728,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854728,"endTimeSeconds":1611854730,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854730,"endTimeSeconds":1611854732,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854732,"endTimeSeconds":1611854734,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854734,"endTimeSeconds":1611854736,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854736,"endTimeSeconds":1611854738,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854738,"endTimeSeconds":1611854740,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854740,"endTimeSeconds":1611854742,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854742,"endTimeSeconds":1611854744,"inspectedCount":0},{"results":[{"average":null}],"beginTimeSeconds":1611854744,"endTimeSeconds":1611854746,"inspectedCount":0}]},"metadata":{"eventTypes":["MongodSample"],"eventType":"MongodSample","openEnded":false,"beginTime":"2021-01-28T17:24:46Z","endTime":"2021-01-28T17:25:46Z","beginTimeMillis":1611854686000,"endTimeMillis":1611854746000,"rawSince":"'2021-01-28 17:24:46'","rawUntil":"'2021-01-28 17:25:46'","rawCompareWith":"","bucketSizeMillis":2000,"facetExpression":"`displayName`","guid":"00116e92-7d9a-c2ce-a90c-6d6e822a152e","routerGuid":"99856555-8b3a-6ff1-b795-f64448e7ac11","messages":[],"facet":"displayName","offset":0,"limit":10,"contents":{"messages":[],"timeSeries":{"messages":[],"contents":[{"function":"average","attribute":"operation.scanAndOrderPerSecond","simple":true}]}}}}








https://insights-api.newrelic.com/v1/accounts/1550954/query?nrql=SELECT average(operation.scanAndOrderPerSecond) FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster = 'rs12-s1'  SINCE '2021-02-01T15:21:18Z' UNTIL '2021-02-01T15:22:18Z'
https://insights-api.newrelic.com/v1/accounts/1550954/query?nrql=SELECT average(operation.scanAndOrderPerSecond) FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster = 'rs12-s2' SINCE '2021-02-01T15:21:18Z' UNTIL '2021-02-01T15:22:18Z'



nrql_scan_and_order_rs12_s1_es_url = newrelic_api_insight_url + "query?nrql=" \
        "SELECT average(operation.scanAndOrderPerSecond) " \
        "FROM MongodSample " \
        "where label.mongoCluster IN ('" + entity_name + "','rs12-s1') " \
        " SINCE '" + pasttime + "' UNTIL '" + currenttime + "'"
        nrql_scan_and_order_rs12_s2_es_url = newrelic_api_insight_url + "query?nrql=" \
        "SELECT average(operation.scanAndOrderPerSecond) " \
        "FROM MongodSample " \
        "where label.mongoCluster IN ('" + entity_name + "','rs12-s2') " \
        " SINCE '" + pasttime + "' UNTIL '" + currenttime + "'"







SELECT average(opcounters.queryPerSecond) AS 'query' FROM MongodSample WHERE label.mongoCluster = 'rs12-s2' FACET displayName TIMESERIES



SELECT average(operation.scanAndOrderPerSecond) FROM MongodSample WHERE label.mongoCluster = 'rs12-s2' FACET displayName TIMESERIES


core docs

purchase order ack
invoice

shiping and notice


non core

procurement


org-> custom org ->ghx->adapter

globalsettings-> adapter types

in testframework only inbound outbound adapter set by (org inbuild)

Doc flow -> routefound -> we can see outbound adapters

>>>>>>>>>>>>>>>>>>>>>>>>>..>>>>>>




{ {"$and": [{"schedule": {"$gte": "2021-03-08 07:44:40 PM"}}, {"schedule": {"$regex": "\\Qpm\\E", "$options": ""}}, {"schedule": {"$lte": "2021-03-08 07:49:40 PM"}}, {"schedule": {"$lte": "pm"}}]}  }



issuetype in (Sub-task) AND worklogAuthor = currentUser() AND worklogDate >= 2021-03-01 AND worklogDate <= 2021-03-07 AND issueFunction in aggregateExpression("Total tracked", "timespent.sum()")

>>>>>>>>>>>>>>>>>>>

ES SNAPSHOT AND RESTORE

5ab0a3e05146940b413ddb68
5ab0a3e05146940b413ddb68

tfwuser

Test-framework123!
Test-framework123!

http://localhost:8080/ui-heimdall/lang/en/testFramework/dashboard/5ab0a3e05146940b413ddb68

curl -XGET 'https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com/_snapshot/_status'
https://internal-testfw-cxtf-1707-ui-heimdall-elb-1956964273.us-west-2.elb.amazonaws.com/lang/en/testFramework/dashboard/5fa2af6300928a2f2396e842

if u are able to execute then I should also be able to

https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains-snapshots.html

https://docs.aws.amazon.com/elasticsearch-service/latest/developerguide/es-managedomains-snapshots.html#es-managedomains-snapshot-registerdirectory

./multielasticdump --direction=dump --match='^dev-aws-dynamodb-metrics.*$' --limit=10000 --input=https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com --output=/tmp/es

Usage Examples
# backup ES indices & all their type to the es_backup folder
multielasticdump \
  --direction=dump \
  --match='^.*$' \
  --input=http://production.es.com:9200 \
  --output=/tmp/es_backup

# Only backup ES indices ending with a prefix of `-index` (match regex). 
# Only the indices data will be backed up. All other types are ignored.
# NB: analyzer & alias types are ignored by default
multielasticdump \
  --direction=dump \
  --match='^.*-index$'\
  --input=http://production.es.com:9200 \
  --ignoreType='mapping,settings,template' \
  --output=/tmp/es_backup


Commands to move one index data from one server/cluster to another using elasticdump.

# Copy an index from production to staging with analyzer and mapping:
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=http://staging.es.com:9200/my_index \
  --type=analyzer
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=http://staging.es.com:9200/my_index \
  --type=mapping
elasticdump \
  --input=http://production.es.com:9200/my_index \
  --output=http://staging.es.com:9200/my_index \
  --type=data
2. Commands to move all indices data from one server/cluster to another using multielasticdump.

Backup

multielasticdump \
  --direction=dump \
  --match='^.*$' \
  --limit=10000 \
  --input=http://production.es.com:9200 \
  --output=/tmp 
Restore

multielasticdump \
  --direction=load \
  --match='^.*$' \
  --limit=10000 \
  --input=/tmp \
  --output=http://staging.es.com:9200 
Note:

If the --direction is dump, which is the default, --input MUST be a URL for the base location of an ElasticSearch server (i.e. http://localhost:9200) and --output MUST be a directory. Each index that does match will have a data, mapping, and analyzer file created.

For loading files that you have dumped from multi-elasticsearch, --direction should be set to load, --input MUST be a directory of a multielasticsearch dump and --output MUST be a Elasticsearch server URL.

The 2nd command will take a backup of settings, mappings, template and data itself as JSON files.

The --limit should not be more than 10000 otherwise, it will give an exception.

Get more details here.
share  improve this answer

npm install -g elasticdump
elasticdump --input=http://mysrc.com:9200/my_index --output=http://mydest.com:9200/my_index --type=mapping
elasticdump --input=http://mysrc.com:9200/my_index --output=http://mydest.com:9200/my_index --type=data

https://stackoverflow.com/questions/56625160/elasticdump-how-do-i-use-offset


curl -XGET 'https://us-west-2-testframework-es.awsdsi.ghx.com:80/dev-newrelic-cpu-utilization/_search' -H 'Content-Type: application/json' -d  ' {"query" : {"match_all" : {}}}' -k


curl -XGET 'https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/_search' -H 'Content-Type: application/json' -d ' {"query" : {"match_all" : {}}}'

 curl -XGET 'https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/_search' -H 'Content-Type: application/json' -d ' {"query" : {"match_all" : {}}}' -k

https://corex-dev.awsdsi.ghx.com/lang/en/audit/TRX9438481c1fe04ab6a47ebcffa624c272

auditTrail

curl -XPOST 'https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/_snapshot/cs-automated/2020-11-05t06-28-40.b359d54f-a907-402a-86f4-a126d08f0ead/_restore' -d '{"indices": "-.kibana*,-.opendistro_security"}' -H 'Content-Type: application/json'


nohup ./elasticdump --input=http://host/common --output=http://host/common --type=data --searchBody='{"from": 1000, "size": 1000, "query": { "match_all": {} }}' &


npm install --prefix /home/sys-user/Softwares/ elasticdump

us-west-2-testframework-es.awsdsi.ghx.com


https://aws.amazon.com/premiumsupport/knowledge-center/prior-snapshot-error-elasticsearch/

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/_search?pretty" -H 'Content-Type: application/json' -d'
{
"query": {
"match_all": {}
}
}
'

 curl -XGET 'https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com/_snapshot?pretty'
{
  "cs-automated-enc" : {
    "type" : "s3"
  }
}


curl -XGET 'https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/_snapshot?pretty'

curl -X GET  'https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/_cat/snapshots/cs-automated?v&s=id'

curl -XGET '"https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/_snapshot/_status'

curl -XGET 'https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com/_snapshot/cs-automated/_all?pretty'

curl -X GET  'https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com/_cat/snapshots/cs-automated?v&s=id'

curl -XGET 'elasticsearch-domain-endpoint/_snapshot/_status'

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/_cat/indices/twi*?v&s=index&pretty"


https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/_cat/indices/twi*?v&s=index&pretty

npm install --prefix /home/sys-user/elastic/ elasticdump


curl -XPOST "search-test-framework-es2-rh4ypdodfobsgmd54nfsnphatm.us-west-2.es.amazonaws.com/testfw-replay-dev-5d9f38a37a3e50124c942a4e-cpu-utilization/_search?v&pretty" -d '
{
"query" : {
"match_all" : {}
}
}'


url = "https://postman-echo.com/post"
headers = {"content-type": "application/json", "Accept-Charset": "UTF-8"}
r = requests.post(url, data={"sample":"data"}, headers=headers)
data = r.json()
store response


print(data)




export PATH=$PATH:/tmp/npm/node-v14.15.0-linux-x64/bin


>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


    /*
     * public static void identify(InputStream documentInputStream, Map<String, Object> extractionMetadata) throws SmooksException {
     * if (documentInputStream == null) {
     * throw new SmooksException("The document input stream is null");
     * }
     * if (extractionMetadata == null) {
     * throw new SmooksException("The extraction metadata is null");
     * }
     * try {
     * Smooks smooks = smooksInstanceProvider.getSmooksInstance(extractionMetadata);
     * System.out.println("---3---");
     * JavaResult result = new JavaResult();
     * if (DocType.EDI.getName().equals(extractionMetadata.get(DocumentContext.Key.DOC_TYPE.getKey()))) {
     * if (extractionMetadata.get(DocumentContext.Key.FIELD_DELIMITER.getKey())
     * .equals(extractionMetadata.get(DocumentContext.Key.SUB_FIELD_DELIMITER.getKey()))
     * || extractionMetadata.get(DocumentContext.Key.SEGMENT_TERMINATOR.getKey())
     * .equals(extractionMetadata.get(DocumentContext.Key.SUB_FIELD_DELIMITER.getKey()))) {
     * documentInputStream = new MatchFieldSubFieldInputStream(documentInputStream);
     * }
     * }
     * String encodingObject = (String) extractionMetadata.get(DocumentContext.Key.ENCODING.getKey());
     * String encoding = StringUtils.isNotEmpty(encodingObject) ? encodingObject : Encoding.UTF_8.getName();
     * synchronized (lockObject) {
     * smooks.filterSource(new StreamSource(new InputStreamReader(documentInputStream, encoding)), result);
     * }
     * Map<String, Object> smooksResultsMap = result.getResultMap();
     * Map<String, Object> extractedProperties = new HashMap<>();
     * if (smooksResultsMap != null) {
     * for (String key : smooksResultsMap.keySet()) {
     * if (key.contains(DOCUMENT_METADATA_KEY)) {
     * @SuppressWarnings("unchecked")
     * Map<String, Object> documentMetadata = (Map<String, Object>) smooksResultsMap.get(key);
     * if (documentMetadata != null) {
     * extractedProperties.putAll(documentMetadata);
     * }
     * }
     * }
     * SMOOKS_MAPPING_ATTRIBUTES_TO_REMOVE.stream().forEach(key -> extractedProperties.remove(key));
     * }
     * return new ExtractionResults(extractedProperties);
     * } catch (Exception e) {
     * LOGGER.error("SmooksDocumentIdentifier - Unable to extract data for identification", e);
     * throw new SmooksException("Unable to extract data for identification", e);
     * }
     * }
     * // public Smooks getSmooksInstance(Map<String, Object> docMetaData) throws SmooksException {
     * // Map<String, Smooks> smooksInstanceMap = new HashMap<String, Smooks>();
     * // if (docMetaData == null) {
     * // throw new SmooksException("The specified docMetaData is null");
     * // }
     * // Smooks smooksInstance = null;
     * // String docType = (String) docMetaData.get(DocumentContext.Key.DOC_TYPE.getKey());
     * // if (docType == null) {
     * // throw new SmooksException("There was no doc type supplied in the docMetadata");
     * // }
     * //
     * // String smooksConfigId = (String) docMetaData.get(DocumentContext.Key.SMOOKS_CONFIG_ID.getKey());
     * // if (StringUtils.isEmpty(smooksConfigId)) {
     * // throw new SmooksException("There was no Smooks Config ID supplied in the docMetadata");
     * // }
     * // String smooksConfigIdVersion = (String) docMetaData.get(DocumentContext.Key.SMOOKS_CONFIG_ID_VERSION.getKey());
     * //
     * // String smooksInstanceMapKey = smooksConfigId + (StringUtils.isEmpty(smooksConfigIdVersion) ? "" : smooksConfigIdVersion);
     * //
     * // String smooksMappingId = (String) docMetaData.get(DocumentContext.Key.SMOOKS_MAPPING_ID.getKey());
     * // if (StringUtils.isNotEmpty(smooksMappingId)) {
     * // smooksInstanceMapKey += ";" + smooksMappingId;
     * // }
     * //
     * // boolean requiresEdiParsing = SmooksDocTypeUtil.requiresEDIParsing(docType);
     * // if (requiresEdiParsing) {
     * // smooksInstanceMapKey += ";";
     * ///* getEdiDelimitersAsString(docMetaData);
     * //
     */ //}
//
// if (smooksInstanceMap.containsKey(smooksInstanceMapKey)) {
// smooksInstance = smooksInstanceMap.get(smooksInstanceMapKey);
// } else {
// if (requiresEdiParsing && smooksMappingId == null) {
// throw new SmooksException(
// String.format("Documents of type %s require a Smooks Mapping Configuration which was not supplied", docType));
// }
// System.out.println("---4---");
// try (InputStream smooksConfigFileInputStream = new LocalResourceSmooksConfigurationLoader().getIdentification(smooksConfigId,
// smooksConfigIdVersion)) {
// if (smooksConfigFileInputStream == null) {
// throw new SmooksException(String.format("Unable to retrieve the Smooks Configuration File for %s", smooksConfigId));
// }
// smooksInstance = new Smooks(smooksConfigFileInputStream);
//
// if (requiresEdiParsing) {
// smooksInstance.setReaderConfig(new EdiReaderConfigurator(smooksMappingId, docMetaData));
// }
// } catch (Exception e) {
// throw new SmooksException(String.format("Unable to create the Smooks Configuration File for %s", smooksConfigId), e);
// }
// smooksInstanceMap.put(smooksInstanceMapKey, smooksInstance);
// }
// System.out.println("---5---");
// return smooksInstance;
// } ->ActivityFlowFilterParamVO



FlowDashboardREST.java -> search -> FlowSearchFactory.java -> ActivityFlowService.java ->ActivityFlowServiceImpl.java ->FlowSearchCriteriaFactory.java ->ActivityFlowFilterParamVO.java ->IFlowSearchCriteria.java ->AdvanceFlowSearchCriteria.java, BasicFlowSearchCriteria.java

dashboard.html ->dashboard-controller.js ->advancedSearch.html ->advanceSearch-controller.js

>>>>>>>>>>>>>

FLUENTD CHANGES:

s/cf-config-logstash-jmx.py


1627663192301,1122,s_dev_load_10_2_6_0_SNAPSHOT_2021_07_30T16_30_08_27908Z_TC1_kZNGh_BkJPF_RzbOc_jlckU_zMt_qFAIr_RERfD_DztnP_gbQcX_SeNXu_pTGdJ_VoQIC_FZQzA_ZohAy_heBpD_Olzll_itWjZ_jUPlR_JIuug_HJjWy_WstPM_uMaZV_wPUwa_aiwyJ_fDaHV,200,SENT=true, 1-1,,true,,0,0,1,1,0,0,0


ESSearch [NOCOMP][NOMETHOD][Engine-ALL][|NT-dev-minion-jtl-logs-2021.08.03|AL-dev-minion-jtl-logs_all|FI-dev-minion-jtl-logs-2021.08.03|], Total 0 records matched in 0ms, Query - {"bool":{"must":{"match":{"label":"test_2009_2_6_0_SNAPSHOT_2021_08_03T15_00_21_194778Z_TC_QeTLE_MDynl"}}}}

curl -H "Content-Type: application/json" -XGET 'https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-minion-jtl-logs_2021.07.29/_search?pretty' -d '
{
"query" : {"match_all:{}}'


curl -H "Content-Type: application/json" -XGET 'https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-minion-jtl-logs_2021.07.29/_search?pretty' -d '
{
"query" : {
"match_all" : {}
}
}'


test_2009_2_6_0_SNAPSHOT_2021_07_29T18_46_37_318458Z_TC_QeTLE_qoEiJ

curl -H "Content-Type: application/json" -XGET 'https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-minion-jtl-logs-2021.07.29/_search?pretty' -d '
{
"query" : {"bool":{"must":{"match":{"label":"test_2009_2_6_0_SNAPSHOT_2021_07_29T18_46_37_318458Z_TC_QeTLE_qoEiJ"}}}}
}'


{"baselineTestResultName":"test_2009_2_6_0_SNAPSHOT_2021_08_03T15_00_21_194778Z","comparedTestResultName":"test_2009_2_6_0_SNAPSHOT_2021_08_03T14_03_28_343124Z","cpuValues":[{"name":"DEV-io-engine","baselineValue":9.42,"comparedTestRunValue":13.13},{"name":"DEV-jobs","baselineValue":9.03,"comparedTestRunValue":10.88},{"name":"DEV-data-poller","baselineValue":1.26,"comparedTestRunValue":1.27},{"name":"DEV TPM","baselineValue":7.0,"comparedTestRunValue":7.47},{"name":"DEV MONGO AUDIT","baselineValue":13.84,"comparedTestRunValue":14.54},{"name":"DEV MONGO BUSINESS TRANSACTION","baselineValue":2.42,"comparedTestRunValue":2.44},{"name":"DEV-processing-engine","baselineValue":13.77,"comparedTestRunValue":13.24}],"cpuMaxValues":[{"name":"DEV-io-engine","baselineValue":82.33,"comparedTestRunValue":99.8},{"name":"DEV-jobs","baselineValue":72.61,"comparedTestRunValue":70.3},{"name":"DEV-data-poller","baselineValue":6.85,"comparedTestRunValue":7.25},{"name":"DEV TPM","baselineValue":51.23,"comparedTestRunValue":49.83},{"name":"DEV MONGO AUDIT","baselineValue":53.59,"comparedTestRunValue":60.0},{"name":"DEV MONGO BUSINESS TRANSACTION","baselineValue":12.35,"comparedTestRunValue":15.81},{"name":"DEV-processing-engine","baselineValue":90.08,"comparedTestRunValue":85.15}],"comparisonDetails":[{"name":"corex-tpm","baselineValue":56.48,"comparedTestRunValue":54.41},{"name":"DEV-io-engine-Hikari-connections","baselineValue":0.92,"comparedTestRunValue":0.91},{"name":"DEV-jobs-Hikari-connections","baselineValue":0.68,"comparedTestRunValue":1.24},{"name":"DEV-data-poller-Hikari-connections","baselineValue":0.5,"comparedTestRunValue":0.66},{"name":"DEV-processing-engine-Hikari-connections","baselineValue":0.48,"comparedTestRunValue":0.42},{"name":"Dynamodb-Consumed-Read-Capacity","baselineValue":0.05,"comparedTestRunValue":0.05},{"name":"Dynamodb-Consumed-Write-Capacity","baselineValue":0.05,"comparedTestRunValue":0.05},{"name":"Dynamodb-Conditional-Check-Failed","baselineValue":1.0,"comparedTestRunValue":1.0}],"comparisonMaxDetails":[{"name":"corex-tpm","baselineValue":110.0,"comparedTestRunValue":110.0},{"name":"DEV-io-engine-Hikari-connections","baselineValue":5.35,"comparedTestRunValue":29.76},{"name":"DEV-jobs-Hikari-connections","baselineValue":219.16,"comparedTestRunValue":463.48},{"name":"DEV-data-poller-Hikari-connections","baselineValue":3.27,"comparedTestRunValue":2.95},{"name":"DEV-processing-engine-Hikari-connections","baselineValue":72.42,"comparedTestRunValue":27.07},{"name":"Dynamodb-Consumed-Read-Capacity","baselineValue":0.18,"comparedTestRunValue":0.13},{"name":"Dynamodb-Consumed-Write-Capacity","baselineValue":0.18,"comparedTestRunValue":0.13},{"name":"Dynamodb-Conditional-Check-Failed","baselineValue":1.0,"comparedTestRunValue":1.0}],"jvmheapMemoryValues":[{"name":"DEV-io-engine","baselineValue":0.0,"comparedTestRunValue":0.0},{"name":"DEV-jobs","baselineValue":0.0,"comparedTestRunValue":0.0},{"name":"DEV-data-poller","baselineValue":0.0,"comparedTestRunValue":0.0},{"name":"DEV TPM","baselineValue":0.0,"comparedTestRunValue":0.0},{"name":"DEV MONGO AUDIT","baselineValue":3.334720289893E10,"comparedTestRunValue":3.33323325022E10},{"name":"DEV MONGO BUSINESS TRANSACTION","baselineValue":1.9196342272E10,"comparedTestRunValue":1.9196342272E10},{"name":"DEV-processing-engine","baselineValue":0.0,"comparedTestRunValue":0.0}]}

Hackfest REF:

//// -- LEVEL 1
//// -- Tables and References

// Creating tables
Table RESOURCE_AREA as U {
  RESOURCE_AREA_ID int [pk, increment] // auto-increment
  NAME varchar
  GROUP_ID int
  CREATED_BY varchar
CREATED_DATE timestamp
  UPDATED_BY varchar
  UPDATED_DATE timestamp
}

Table countries {
  code int [pk]
  name varchar
  continent_name varchar
 }

// Creating references
// You can also define relaionship separately
// > many-to-one; < one-to-many; - one-to-one
//Ref: U.country_code > countries.code  
//Ref: merchants.country_code > countries.code

//----------------------------------------------//

//// -- LEVEL 2
//// -- Adding column settings

Table order_items {
  order_id int [ref: > orders.id] // inline relationship (many-to-one)
  product_id int
  quantity int [default: 1] // default value
}

Ref: order_items.product_id > products.id

Table orders {
  id int [pk] // primary key
  user_id int [not null, unique]
  status varchar
  created_at varchar [note: 'When order created'] // add column note
}

//----------------------------------------------//

//// -- Level 3 
//// -- Enum, Indexes

// Enum for 'products' table below
Enum products_status {
  out_of_stock
  in_stock
  running_low [note: 'less than 20'] // add column note
}

// Indexes: You can define a single or multi-column index 
Table products {
  id int [pk]
  name varchar
  merchant_id int [not null]
  price int
  status products_status
  created_at datetime [default: `now()`]
  
  Indexes {
    (merchant_id, status) [name:'product_status']
    id [unique]
  }
}

Table merchants {
  id int
  country_code int
  merchant_name varchar
  
  "created at" varchar
  admin_id int [ref: > U.id]
  Indexes {
    (id, country_code) [pk]
  }
}

Table merchant_periods {
  id int [pk]
  merchant_id int
  country_code int
  start_date datetime
  end_date datetime
}

Ref: products.merchant_id > merchants.id // many-to-one
//composite foreign key
Ref: merchant_periods.(merchant_id, country_code) > merchants.(id, country_code)





Ref: "PRODUCT"."PRODUCT_ID" < "PRODUCT"."HANDLE"


Ref: "ATTRIBUTE_CONFIGURATION"."ATTRIBUTE_ID" < "ATTRIBUTE"."ATTRIBUTE_ID"



Ref: "ATTRIBUTE_CONFIGURATION"."PERMISSION_ID" < "PERMISSION"."PERMISSION_ID"

Ref: "PRODUCT_ROLE"."PRODUCT_ROLE_ID" < "ROLE_PERMISSION"."PRODUCT_ROLE_ID"

Ref: "ATTRIBUTE_CONFIGURATION"."PRODUCT_ROLE_ID" < "PRODUCT_ROLE"."PRODUCT_ROLE_ID"

Ref: "ATTRIBUTE_CONFIGURATION"."RESOURCE_AREA_ID" < "RESOURCE_AREA"."RESOURCE_AREA_ID"

Ref: "ROLE_PERMISSION"."RESOURE_GROUP_ID" < "RESOURCE_GROUP"."RESOURCE_GROUP_ID"

JIRA INTEGRATION:

curl -D -u spkannan:Corex@tfw123 -X GET -H "Content-Type: application/json" https://workflow.ghx.com/rest/api/2/search?jql=assignee=spkannan


Seems we can do using bots and api's.
Also with python it is more easy with pybot but we need this integration in Java.
 
Trying few java codes

MediaWikiBot

Wiki.LogEntry

Curl command will also work for posting file and messages

[https://www.codota.com/code/java/methods/org.wikipedia.Wiki/getUploads
] https://www.mediawiki.org/wiki/Topic:Rqroucz666g8gi8o

https://confluence.atlassian.com/confkb/using-the-confluence-rest-api-to-upload-an-attachment-to-one-or-more-pages-1014274390.html

https://www.mediawiki.org/wiki/Manual:Creating_a_bot

 

https://github.com/addwiki/mediawiki-api

https://www.mediawiki.org/wiki/Manual:Creating_a_bot

https://github.com/addwiki/mediawiki-api-base



we could able to upload image as attachement to Testing page.

I create a page called Testing wiki and uploaded JmeterProgress.png from my local machine to wiki via curl command


I had internal discussion with Sivakumaran Palanichamy, he suggested to analyse on uploading to wiki.

curl -u spkannan:Corex@tfw123 -X POST -H "X-Atlassian-Token: nocheck" -F "file=@JmeterProgress.png" -F "comment=File attached via REST API" https://hub.ghx.com/rest/api/content/123933614/child/attachment 2>/dev/null | jq -r '.results[].title'

 

derived curl command to upload file to wiki after working out and analysing multiple curl commands

Copy


testuser:

CmMgR7OQF1Kgpw

$2a$07$Y9vHUfyqr/tcoUTojV4F.eKhqmiueoFywVjAkGNZ335aNeULQLMYW

$2a$07$Y9vHUfyqr/tcoUTojV4F.eKhqmiueoFywVjAkGNZ335aNeULQLMYW

$2a$07$Y9vHUfyqr/tcoUTojV4F.eKhqmiueoFywVjAkGNZ335aNeULQLMYW


NOTES JIRA:

   static HttpHeaders createHeaders(String username, String password) {
        return new HttpHeaders() {
            {
                String auth = username + ":" + password;
                byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(Charset.forName("US-ASCII")));
                String authHeader = "Basic " + new String(encodedAuth);
                set("Authorization", authHeader);
            }
        };
    }


    @Override
    public List<JiraIssueDetail> fetchjiraId(String issueKey) throws TestFWServerException {
        List<JiraIssueDetail> jiraIssues = Lists.newArrayList();

        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
        String startURL = new StringBuilder().append(HTTPS_PROTOCOL).append(
                "workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query="
                        + issueKey)
                .toString();
        try {
            RestTemplate restTemplate = SecurityUtil.getRestTemplate();
            ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET,
                    new HttpEntity(createHeaders(DAOUtil.getUserName().toString(),
                            SecurityContextHolder.getContext().getAuthentication().getCredentials().toString())),
                    String.class);
            String body = output.getBody().toString();
            JSONObject responseJson = new JSONObject(body);
            JSONArray jsonArray = new JSONArray(responseJson.get("sections").toString());
            JSONObject section = jsonArray.getJSONObject(0);
            JSONArray issues = new JSONArray(section.get("issues").toString());
            for (int i = 0; i < issues.length(); i++) {
                JSONObject issue = issues.getJSONObject(i);
                JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
                jiraIssueDetail.setKey(issue.get("key").toString());
                jiraIssueDetail.setSummary(issue.get("summary").toString());
                jiraIssues.add(jiraIssueDetail);
            }
            System.out.println(jiraIssues);

        } catch (Exception e) {
            LOGGER.error("Error getting jira id", e);
        }


        if (jiraIssues.size() == 0) {
            try {
                startURL = new StringBuilder().append(HTTPS_PROTOCOL)
                        .append("workflow.ghx.com/rest/api/2/search?jql=project=CXTF AND key = "+ issueKey.toUpperCase()).toString();
                RestTemplate restTemplate = SecurityUtil.getRestTemplate();
                ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET,
                        new HttpEntity(createHeaders(DAOUtil.getUserName().toString(),
                                SecurityContextHolder.getContext().getAuthentication().getCredentials().toString())), String.class);
                String body = output.getBody().toString();
                JSONObject responseJson = new JSONObject(body);
                JSONArray issues = new JSONArray(responseJson.get("issues").toString());
                for (int i = 0; i < issues.length(); i++) {
                    JSONObject issue = issues.getJSONObject(i);
                    JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
                    jiraIssueDetail.setKey(issue.get("key").toString());
                    JSONObject fields = issue.getJSONObject("fields");
                    jiraIssueDetail.setSummary(fields.get("summary").toString());
                    jiraIssues.add(jiraIssueDetail);
                }
                LOGGER.debug("jiraIssues:{}",jiraIssues);
            } catch (RestClientException | JSONException e) {
                LOGGER.error("Error getting jira id", e);
                throw new TestFWServerException("The issue key " + issueKey + " does not exist.");
            }
        }
        return jiraIssues;
    }
    public static void main(String[] args) {
        List<JiraIssueDetail> jiraIssues = Lists.newArrayList();

        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
        String startURL = new StringBuilder().append(HTTPS_PROTOCOL).append(
                "workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query="
                        + "EGX")
                .toString();
        try {
            RestTemplate restTemplate = SecurityUtil.getRestTemplate();
            ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET,
                    new HttpEntity(createHeaders(DAOUtil.getUserName().toString(),
                            SecurityContextHolder.getContext().getAuthentication().getCredentials().toString())),
                    String.class);
            String body = output.getBody().toString();
            JSONObject responseJson = new JSONObject(body);
            JSONArray jsonArray = new JSONArray(responseJson.get("sections").toString());
            JSONObject section = jsonArray.getJSONObject(0);
            JSONArray issues = new JSONArray(section.get("issues").toString());
            for (int i = 0; i < issues.length(); i++) {
                JSONObject issue = issues.getJSONObject(i);
                JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
                jiraIssueDetail.setKey(issue.get("key").toString());
                jiraIssueDetail.setSummary(issue.get("summary").toString());
                jiraIssues.add(jiraIssueDetail);
            }
            LOGGER.debug("jiraIssues:{}",jiraIssues);
        } catch (Exception e) {
            LOGGER.error("Error getting jira id", e);
        }

    }















package com.ghx.testframework.api.service.impl;

import java.io.IOException;
import java.nio.charset.Charset;
import java.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.MessageFormat;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.EnumMap;
import java.util.EnumSet;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Objects;
import java.util.Optional;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang.math.NumberUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.commons.net.util.Base64;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
import org.bson.types.ObjectId;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestClientException;
import org.springframework.web.client.RestTemplate;

import com.amazonaws.services.cloudformation.model.StackStatus;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.ghx.aws.utils.ec2.EC2Utils;
import com.ghx.common.log.GHXLogger;
import com.ghx.common.log.GHXLoggerFactory;
import com.ghx.common.security.util.SecurityUtil;
import com.ghx.configsvc.ConfigSvc;
import com.ghx.configsvc.ConfigSvcFactory;
import com.ghx.data.common.Criteria;
import com.ghx.data.common.Field;
import com.ghx.data.util.DateUtil;
import com.ghx.internationalization.annotation.Internationalization;
import com.ghx.internationalization.handler.InternationalizationFactory;
import com.ghx.testframework.api.common.MinionProcessingDetails;
import com.ghx.testframework.api.common.MinionProperties;
import com.ghx.testframework.api.common.MinionTestCaseProperties;
import com.ghx.testframework.api.dao.MinionPropertiesDAO;
import com.ghx.testframework.api.dao.ScenarioDAO;
import com.ghx.testframework.api.dao.TestResultDAO;
import com.ghx.testframework.api.dao.TestStackDAO;
import com.ghx.testframework.api.entity.ActivityResult;
import com.ghx.testframework.api.entity.AttachmentFields;
import com.ghx.testframework.api.entity.ClusterInfo;
import com.ghx.testframework.api.entity.DiscrepancyFlowId;
import com.ghx.testframework.api.entity.DiscrepancyInfo;
import com.ghx.testframework.api.entity.Document;
import com.ghx.testframework.api.entity.JiraIssueDetail;
import com.ghx.testframework.api.entity.ReleaseInfo;
import com.ghx.testframework.api.entity.ReplayScenario;
import com.ghx.testframework.api.entity.Scenario;
import com.ghx.testframework.api.entity.ScenarioStatus;
import com.ghx.testframework.api.entity.SlackMessage;
import com.ghx.testframework.api.entity.StatusComparision;
import com.ghx.testframework.api.entity.TestCase;
import com.ghx.testframework.api.entity.TestCaseResult;
import com.ghx.testframework.api.entity.TestResult;
import com.ghx.testframework.api.entity.TestResultComment;
import com.ghx.testframework.api.entity.TestResultJiraTicket;
import com.ghx.testframework.api.entity.TestRunHistoryInfo;
import com.ghx.testframework.api.entity.TestStack;
import com.ghx.testframework.api.entity.TrackingFlowStatistics;
import com.ghx.testframework.api.enums.ClusterStatus;
import com.ghx.testframework.api.enums.TestCaseResultField;
import com.ghx.testframework.api.service.TestResultService;
import com.ghx.testframework.api.service.TestStackService;
import com.ghx.testframework.api.uiconfig.validators.TFNameValidator;
import com.ghx.testframework.api.util.DAOUtil;
import com.ghx.testframework.api.util.SlackUtils;
import com.ghx.testframework.api.util.TestEngineRequestUrlGenerator;
import com.ghx.testframework.utils.api.TFStackManager;
import com.ghx.testframework.utils.api.WebApplicationStatusService;
import com.ghx.testframework.utils.enums.TFConfigKeys;
import com.ghx.testframework.utils.enums.TFConstants;
import com.ghx.testframework.utils.enums.TestFrameworkStatus;
import com.ghx.testframework.utils.exception.TestFWResourceNotFoundException;
import com.ghx.testframework.utils.exception.TestFWServerException;
import com.ghx.testframework.utils.helpers.RequestToGRUHelper;
import com.ghx.testframework.utils.helpers.TFClientHttpRequestFactory;
import com.ghx.testframework.utils.helpers.TFHostnameVerifier;
import com.ghx.testframework.utils.model.stackmanager.StackManagerBasicRequest;
import com.ghx.tpm.api.internalization.IInternalizator;
import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.util.concurrent.ThreadFactoryBuilder;


    public static void main(String[] args) {
        List<JiraIssueDetail> jiraIssues = Lists.newArrayList();

        Authentication auth = SecurityContextHolder.getContext().getAuthentication();
        String startURL = new StringBuilder().append(HTTPS_PROTOCOL).append(
                "workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query="
                        + "EGX")
                .toString();
        try {
            RestTemplate restTemplate = SecurityUtil.getRestTemplate();
            ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET,
                    new HttpEntity(createHeaders(DAOUtil.getUserName().toString(),
                            SecurityContextHolder.getContext().getAuthentication().getCredentials().toString())),
                    String.class);
            String body = output.getBody().toString();
            JSONObject responseJson = new JSONObject(body);
            JSONArray jsonArray = new JSONArray(responseJson.get("sections").toString());
            JSONObject section = jsonArray.getJSONObject(0);
            JSONArray issues = new JSONArray(section.get("issues").toString());
            for (int i = 0; i < issues.length(); i++) {
                JSONObject issue = issues.getJSONObject(i);
                JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
                jiraIssueDetail.setKey(issue.get("key").toString());
                jiraIssueDetail.setSummary(issue.get("summary").toString());
                jiraIssues.add(jiraIssueDetail);
            }
            LOGGER.debug("jiraIssues:{}",jiraIssues);
        } catch (Exception e) {
            LOGGER.error("Error getting jira id", e);
        }

    }

NOTEST APRIL:

145


CXTF-1586


public static void main(String[] args) {
String command =
  "curl --user spkannan@ghx.com:haripriya -H 'Authorization:Basic BASE64_string' \\ -X GET https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/hosts/8b60c07e700a91ffa76592ab404e21ed/replicaset?retention=3600000";
ProcessBuilder processBuilder = new ProcessBuilder(command.split(" "));
processBuilder.directory(new File("/home/"));
Process process;
/*
* try { process = processBuilder.start(); } catch (IOException e) { // TODO
* Auto-generated catch block e.printStackTrace(); }
*/
/*
* InputStream inputStream = process.getInputStream();
* System.out.println("input stream "+ inputStream); int exitCode =
* process.exitValue();
* process.destroy();
* String command1 =
* "curl -X POST https://postman-echo.com/post --data foo1=bar1&foo2=bar2"; try
* { Process process1 = Runtime.getRuntime().exec(command);
* System.out.println("input stream of runtime"+ process1.getOutputStream()); }
* catch (IOException e) { // TODO Auto-generated catch block
* e.printStackTrace(); }
*/
try {
process = processBuilder.start();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
StringBuilder builder = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
builder.append(line);
builder.append(System.getProperty("line.separator"));
}
String result = builder.toString();
System.out.print(result);

} catch (IOException e) {
System.out.print("error");
e.printStackTrace();
}
}

https://www.baeldung.com/java-curl
https://postman-echo.com/get?foo1=bar1&foo2=bar2
https://docs.atlas.mongodb.com/api/
https://docs.cloudmanager.mongodb.com/tutorial/manage-agent-api-key/



import pymongo
import dns # required for connecting with SRV

client = pymongo.MongoClient("mongodb+srv://kay:myRealPassword@cluster0.mongodb.net/test?w=majority")
db = client.test


MongoClientURI uri = new MongoClientURI(
    "mongodb+srv://spkannan@ghx.com:haripriya@cluster0.mongodb.net/test?w=majority");

MongoClient mongoClient = new MongoClient(uri);
MongoDatabase database = mongoClient.getDatabase("test");


curl --user "{PUBLIC-KEY}:{PRIVATE-KEY}" --digest \
     --request GET "https://cloud.mongodb.com/api/public/v1.0/groups/{PROJECT-ID}/automationConfig?pretty=true" \
     --output currentAutomationConfig.json

  "curl --user {cigztdwr}:{b68db372-6ff0-4e02-907a-534563785cde} --digest --header 'Accept: application/json' --include  --request GET https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/hosts/8b60c07e700a91ffa76592ab404e21ed/replicaset?retention=3600000";

curl --user "{cigztdwr}:{b68db372-6ff0-4e02-907a-534563785cde}" --digest \
     --request GET "https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/hosts/8b60c07e700a91ffa76592ab404e21ed/replicaset?retention=3600000" \
     --output currentAutomationConfig.json


curl -u "spkannan@ghx.com:cigztdwr" --digest -i "https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/sshKeys/545e3e3ae4b08a04fbc21005"

curl -u "<spkannan@ghx.com>:<b68db372-6ff0-4e02-907a-534563785cde>" --digest -i "https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/hosts/8b60c07e700a91ffa76592ab404e21ed/replicaset?retention=3600000"


mms_public_key = 'cigztdwr'
mms_private_key = 'b68db372-6ff0-4e02-907a-534563785cde'
GHX_DEV = '5373a8689194bf134f7a93ad'

mmsApiKey=59436e71d383ad31949cf08916f5f38648c0528157c20efd5ffc7ad1



curl -u "spkannan@ghx.com:59436e71d383ad31949cf08916f5f38648c0528157c20efd5ffc7ad1" -H "Content-Type: application/json" "https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/hosts/8b60c07e700a91ffa76592ab404e21ed/replicaset?retention=3600000"  --digest -X GET -d -i


curl -i -u "spkannan@ghx.com:b68db372-6ff0-4e02-907a-534563785cde" --digest "https://cloud.mongodb.com/v2/5373a8689194bf134f7a93ad#host/replicaSet/5d025aa2d54df78fc4fcfd60"



curl -X GET 'https://cloud.mongodb.com/v2/5373a8689194bf134f7a93ad#host/replicaSet/5d025aa2d54df78fc4fcfd60?api_key=59436e71d383ad31949cf08916f5f38648c0528157c20efd5ffc7ad1'


https://mms.mongodb.com/api/public/v1/groups/5373a8689194bf134f7a93ad/hosts/8b60c07e700a91ffa76592ab404e21ed/metrics


curl --user "spkannan@ghx.com:59436e71d383ad31949cf08916f5f38648c0528157c20efd5ffc7ad1" --digest \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --include \
  --request GET "https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/hosts/8b60c07e700a91ffa76592ab404e21ed/replicaset?retention=3600000"
  

curl -i -u "spkannan@ghx.com:cigztdwr" --digest "https://cloud.mongodb.com/deployment/5373a8689194bf134f7a93ad/replset/5d025aa2d54df78fc4fcfd60"



curl -u "spkannan@ghx.com:b68db372-6ff0-4e02-907a-534563785cde" --digest -i "https://mms.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/5d025aa2d54df78fc4fcfd60/metrics"


curl -i -u "spkannan@ghx.com:cigztdwr" --digest https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e/replicaset?retention=3600000


 curl -u spkannan -X GET 'https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad#hosts/4a071190e0434ff7adca2985c5b5437e/replicaset?retention=3600000?api_key=59436e71d383ad31949cf08916f5f38648c0528157c20efd5ffc7ad1'


curl -u "spkannan@ghx.com:cigztdwr" --digest -i "https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/hosts/8b60c07e700a91ffa76592ab404e21ed/replicaset?retention=3600000"


cigztdwr

https://www.tothenew.com/blog/mongo-monitoring-service-to-ensure-uptime-of-mongodb/

{"cpu":{},"dbstats":{"avgObjSize-count-chart":{"label":"Avg Object Size","series":[{"label":"average obj size","units":{"frequency":"none","type":"bytes"}}],"units":{"frequency":"none","type":"bytes"}},"collections-count-chart":{"label":"Collections","series":[{"label":"collections","units":{"frequency":"none","type":"scalar"}}],"units":{"frequency":"none","type":"scalar"}},"dataSize-count-chart":{"label":"Data Size","series":[{"label":"data size","units":{"frequency":"none","type":"bytes"}}],"units":{"frequency":"none","type":"bytes"}},"indexSize-count-chart":{"label":"Index Size","series":[{"label":"index size","units":{"frequency":"none","type":"bytes"}}],"units":{"frequency":"none","type":"bytes"}},"indexes-count-chart":{"label":"Indexes","series":[{"label":"indexes","units":{"frequency":"none","type":"scalar"}}],"units":{"frequency":"none","type":"scalar"}},"numExtents-count-chart":{"label":"Num Extents","series":[{"label":"extents","units":{"frequency":"none","type":"scalar"}}],"units":{"frequency":"none","type":"scalar"}},"objects-count-chart":{"label":"Objects","series":[{"label":"objects","units":{"frequency":"none","type":"scalar"}}],"units":{"frequency":"none","type":"scalar"}},"storageSize-count-chart":{"label":"Storage Size","series":[{"label":"storage size","units":{"frequency":"none","type":"bytes"}}],"units":{"frequency":"none","type":"bytes"}},"views-count-chart":{"label":"Views","series":[{"label":"views","units":{"frequency":"none","type":"scalar"}}],"units":{"frequency":"none","type":"scalar"}}},"disk":{},"munin":{"fixed-cpu-chart":{"label":"CPU","series":[{"label":"user","units":{"frequency":"none","type":"percent"}},{"label":"nice","units":{"frequency":"none","type":"percent"}},{"label":"system","units":{"frequency":"none","type":"percent"}},{"label":"iowait","units":{"frequency":"none","type":"percent"}},{"label":"irq","units":{"frequency":"none","type":"percent"}},{"label":"softirq","units":{"frequency":"none","type":"percent"}},{"label":"steal","units":{"frequency":"none","type":"percent"}}],"units":{"frequency":"none","type":"percent"}}},"otherCpu":{},"otherDisk":{},"otherMem":{},"realtime":{"realtime-connections":{"label":"Connections","series":[{"label":"connections","units":{"frequency":"none","type":"scalar"}}],"type":"scalar","units":{"frequency":"none","type":"scalar"}},"realtime-cpu":{"label":"CPU","series":[{"label":"cpu","units":{"frequency":"none","type":"percent"}}],"type":"dial","units":{"frequency":"none","type":"percent"}},"realtime-disk-util":{"label":"Disk Util","series":[{"label":"disk-util","units":{"frequency":"none","type":"percent"}}],"type":"dial","units":{"frequency":"none","type":"percent"}},"realtime-memory":{"label":"Sys Mem","series":[{"label":"memory","units":{"frequency":"none","type":"bytes"}},{"label":"max","units":{"frequency":"none","type":"bytes"}}],"type":"dial","units":{"frequency":"none","type":"bytes"}},"realtime-network-in":{"label":"Network In","series":[{"label":"bytes in","units":{"frequency":"second","type":"bytes"}}],"type":"scalar","units":{"frequency":"second","type":"bytes"}},"realtime-network-out":{"label":"Network Out","series":[{"label":"bytes out","units":{"frequency":"second","type":"bytes"}}],"type":"scalar","units":{"frequency":"second","type":"bytes"}},"realtime-opcounters-chart":{"label":"Operations","series":[{"label":"commands","units":{"frequency":"second","type":"scalar"}},{"label":"queries","units":{"frequency":"second","type":"scalar"}},{"label":"updates","units":{"frequency":"second","type":"scalar"}},{"label":"deletes","units":{"frequency":"second","type":"scalar"}},{"label":"getmores","units":{"frequency":"second","type":"scalar"}},{"label":"inserts","units":{"frequency":"second","type":"scalar"}}],"type":"line-chart","units":{"frequency":"second","type":"scalar"}},"realtime-opcounters-repl-chart":{"label":"Replicated Operations","series":[{"label":"commands","units":{"frequency":"second","type":"scalar"}},{"label":"updates","units":{"frequency":"second","type":"scalar"}},{"label":"deletes","units":{"frequency":"second","type":"scalar"}},{"label":"inserts","units":{"frequency":"second","type":"scalar"}}],"type":"line-chart","units":{"frequency":"second","type":"scalar"}},"realtime-query-execution-chart":{"label":"Query Execution Times","series":[{"label":"Time / Read","units":{"frequency":"none","type":"scalar"}},{"label":"Time / Write","units":{"frequency":"none","type":"scalar"}},{"label":"Time / Command","units":{"frequency":"none","type":"scalar"}}],"type":"line-chart","units":{"frequency":"none","type":"scalar"}},"realtime-query-targeting-chart":{"label":"Query Targeting","series":[{"label":"Scanned / Returned","units":{"frequency":"none","type":"scalar"}},{"label":"Scanned Objects / Returned","units":{"frequency":"none","type":"scalar"}}],"type":"line-chart","units":{"frequency":"none","type":"scalar"}},"realtime-reads-writes-chart":{"label":"Reads & Writes","series":[{"label":"active readers","units":{"frequency":"none","type":"scalar"}},{"label":"active writers","units":{"frequency":"none","type":"scalar"}},{"label":"queued readers","units":{"frequency":"none","type":"scalar"}},{"label":"queued writers","units":{"frequency":"none","type":"scalar"}}],"type":"line-chart","units":{"frequency":"none","type":"scalar"}},"realtime-replication-lag-chart":{"label":"Replication Lag","series":[{"label":"Lag Time","units":{"frequency":"none","type":"milliseconds"}}],"type":"line-chart","units":{"frequency":"none","type":"milliseconds"}}},"sharding":{},"status":{"db-storage-total":{"label":"DB Storage","series":[{"label":"db storage","units":{"frequency":"none","type":"bytes"}},{"label":"db data size","units":{"frequency":"none","type":"bytes"}},{"label":"db index size","units":{"frequency":"none","type":"bytes"}}],"units":{"frequency":"none","type":"bytes"}},"document-metrics":{"label":"Document Metrics","series":[{"label":"returned","units":{"frequency":"second","type":"scalar"}},{"label":"inserted","units":{"frequency":"second","type":"scalar"}},{"label":"updated","units":{"frequency":"second","type":"scalar"}},{"label":"deleted","units":{"frequency":"second","type":"scalar"}}],"units":{"frequency":"second","type":"scalar"}},"fixed-asserts-chart":{"label":"Asserts","series":[{"label":"regular","units":{"frequency":"second","type":"scalar"}},{"label":"warning","units":{"frequency":"second","type":"scalar"}},{"label":"msg","units":{"frequency":"second","type":"scalar"}},{"label":"user","units":{"frequency":"second","type":"scalar"}}],"units":{"frequency":"second","type":"scalar"}},"fixed-avg-operation-execution-times-chart":{"label":"Operation Execution Times","series":[{"label":"avg ms/read","units":{"frequency":"none","type":"milliseconds"}},{"label":"avg ms/write","units":{"frequency":"none","type":"milliseconds"}},{"label":"avg ms/write w/o flow control","units":{"frequency":"none","type":"milliseconds"}},{"label":"avg ms/command","units":{"frequency":"none","type":"milliseconds"}}],"units":{"frequency":"none","type":"milliseconds"}},"fixed-connections-chart":{"label":"Connections","series":[{"label":"current","units":{"frequency":"none","type":"scalar"}}],"units":{"frequency":"none","type":"scalar"}},"fixed-cursors-chart":{"label":"Cursors","series":[{"label":"totalOpen","units":{"frequency":"none","type":"scalar"}},{"label":"timedOut","units":{"frequency":"second","type":"scalar"}}],"units":{"frequency":"none","type":"scalar"}},"fixed-extra-info-page-faults-chart":{"label":"Page Faults","series":[{"label":"page faults","units":{"frequency":"second","type":"scalar"}}],"units":{"frequency":"second","type":"scalar"}},"fixed-global-lock-current-queue-chart":{"label":"Queues","series":[{"label":"total","units":{"frequency":"none","type":"scalar"}},{"label":"readers","units":{"frequency":"none","type":"scalar"}},{"label":"writers","units":{"frequency":"none","type":"scalar"}}],"units":{"frequency":"none","type":"scalar"}},"fixed-mem-chart":{"label":"Memory","series":[{"label":"resident","units":{"frequency":"none","type":"megabytes"}},{"label":"virtual","units":{"frequency":"none","type":"megabytes"}},{"label":"mapped","units":{"frequency":"none","type":"megabytes"}}],"units":{"frequency":"none","type":"megabytes"}},"fixed-network-chart":{"label":"Network","series":[{"label":"bytes in","units":{"frequency":"second","type":"bytes"}},{"label":"bytes out","units":{"frequency":"second","type":"bytes"}},{"label":"num requests","units":{"frequency":"second","type":"scalar"}}],"units":{"frequency":"second","type":"bytes"}},"fixed-opcounters-chart":{"label":"Opcounters","series":[{"label":"command","units":{"frequency":"second","type":"scalar"}},{"label":"query","units":{"frequency":"second","type":"scalar"}},{"label":"update","units":{"frequency":"second","type":"scalar"}},{"label":"delete","units":{"frequency":"second","type":"scalar"}},{"label":"getmore","units":{"frequency":"second","type":"scalar"}},{"label":"insert","units":{"frequency":"second","type":"scalar"}}],"units":{"frequency":"second","type":"scalar"}},"fixed-opcounters-repl-chart":{"label":"Opcounters - Repl","series":[{"label":"command","units":{"frequency":"second","type":"scalar"}},{"label":"update","units":{"frequency":"second","type":"scalar"}},{"label":"delete","units":{"frequency":"second","type":"scalar"}},{"label":"insert","units":{"frequency":"second","type":"scalar"}}],"units":{"frequency":"second","type":"scalar"}},"fixed-wtCache-activity-chart":{"label":"Cache Activity","series":[{"label":"read into","units":{"frequency":"second","type":"bytes"}},{"label":"written from","units":{"frequency":"second","type":"bytes"}}],"units":{"frequency":"second","type":"bytes"}},"fixed-wtCache-usage-chart":{"label":"Cache Usage","series":[{"label":"dirty","units":{"frequency":"none","type":"bytes"}},{"label":"used","units":{"frequency":"none","type":"bytes"}}],"units":{"frequency":"none","type":"bytes"}},"fixed-wtTickets-available-chart":{"label":"Tickets Available","series":[{"label":"reads","units":{"frequency":"none","type":"scalar"}},{"label":"writes","units":{"frequency":"none","type":"scalar"}}],"units":{"frequency":"none","type":"scalar"}},"operations":{"label":"Scan and Order","series":[{"label":"scan and order","units":{"frequency":"second","type":"scalar"}}],"units":{"frequency":"second","type":"scalar"}},"oplog-master-lag-time-diff-chart":{"label":"Replication Headroom","series":[{"label":"replication headroom","units":{"frequency":"none","type":"seconds"}}],"units":{"frequency":"none","type":"seconds"}},"oplog-master-time-chart":{"label":"Replication Oplog Window","series":[{"label":"oplog window","units":{"frequency":"none","type":"seconds"}}],"units":{"frequency":"none","type":"seconds"}},"oplog-rate-chart":{"label":"Oplog GB/Hour","series":[{"label":"oplog gb/hour","units":{"frequency":"hour","type":"gigabytes"}}],"units":{"frequency":"hour","type":"gigabytes"}},"oplog-secondary-lag-master-time-chart":{"label":"Replication Lag","series":[{"label":"lag time","units":{"frequency":"none","type":"seconds"}}],"units":{"frequency":"none","type":"seconds"}},"query-executor":{"label":"Query Executor","series":[{"label":"scanned","units":{"frequency":"second","type":"scalar"}},{"label":"scanned objects","units":{"frequency":"second","type":"scalar"}}],"units":{"frequency":"second","type":"scalar"}},"query-targeting":{"label":"Query Targeting","series":[{"label":"scanned / returned","units":{"frequency":"none","type":"scalar"}},{"label":"scanned objects / returned","units":{"frequency":"none","type":"scalar"}}],"units":{"frequency":"none","type":"scalar"}}}}






https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/clusters/5d025aa2d54df78fc4fcfd60





testdev
testdev


mms_public_key = 'cigztdwr'
mms_private_key = 'b68db372-6ff0-4e02-907a-534563785cde'
GHX_DEV = '5373a8689194bf134f7a93ad'

mmsApiKey=59436e71d383ad31949cf08916f5f38648c0528157c20efd5ffc7ad1

curl --digest --user "{PUBLIC-KEY}:{PRIVATE-KEY}" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --request GET "https://cloud.mongodb.com/api/atlas/v1.0/users/{USER-ID}/keys"



curl --digest --user "cigztdwr:b68db372-6ff0-4e02-907a-534563785cde" \
  --header "Content-Type: application/json" \
  --header "Accept: application/json" \
  --request GET "https://cloud.mongodb.com/api/atlas/v1.0/users/{USER-ID}/keys"


curl --user "cigztdwr:b68db372-6ff0-4e02-907a-534563785cde" --digest --include \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --request GET "https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/hosts/8b60c07e700a91ffa76592ab404e21ed/replicaset?retention=3600000/users/byName/spkannan@ghx.com"



curl -i -u "cigztdwr:b68db372-6ff0-4e02-907a-534563785cde" --digest "https://cloud.mongodb.com/v2/5373a8689194bf134f7a93ad#host/replicaSet/5d025aa2d54df78fc4fcfd60"


CoreX-STG-db-eb-s1-01.awsdsi.ghx.com:27027

rs12-s1

// Full command './mongo --host <host> --port <port> —username <user>  —password <pass> admin', However you can just use the following command
> mongo
> use eb-execution
> db.createUser({user:"eb-execution-user", pwd: "eb123", roles: ["readWrite"]})



> mongo
> use event-bus
> db.createUser({user:"event-bus-user", pwd: "eb123", roles: ["readWrite"]})

   MongoClient mongoClient = MongoClients.create("mongodb+srv://admin:mypassword@cluster0-ox90k.mongodb.net/test?retryWrites=true");





iarchive-01.awsdsi.ghx.com -> corex-int-db-archive01.awsdsi.ghx.com
iarchive-02.awsdsi.ghx.com -> corex-int-db-archive02.awsdsi.ghx.com
iarchive-03.awsdsi.ghx.com -> corex-int-db-archive03.awsdsi.ghx.com
bt-mongo-dev-01.awsdsi.ghx.com -> corex-dev-db-bt01.awsdsi.ghx.com
bt-mongo-dev-02.awsdsi.ghx.com -> corex-dev-db-bt01.awsdsi.ghx.com
bt-mongo-dev-03.awsdsi.ghx.com -> corex-dev-db-bt01.awsdsi.ghx.com
bt-mongo-int-01.awsdsi.ghx.com -> corex-int-db-bt01.awsdsi.ghx.com
bt-mongo-int-02.awsdsi.ghx.com -> corex-int-db-bt02.awsdsi.ghx.com
bt-mongo-int-03.awsdsi.ghx.com -> corex-int-db-bt03.awsdsi.ghx.com
bt-mongo-stg-01.awsdsi.ghx.com -> corex-stg-db-bt-config-server01.awsdsi.ghx.com
bt-mongo-stg-02.awsdsi.ghx.com -> corex-stg-db-bt-config-server01.awsdsi.ghx.com
dmongo-01.awsdsi.ghx.com -> corex-dev-db-audit01.awsdsi.ghx.com
dmongo-02.awsdsi.ghx.com -> corex-dev-db-audit01.awsdsi.ghx.com
dmongo-03.awsdsi.ghx.com -> corex-dev-db-audit01.awsdsi.ghx.com
imongo-01.awsdsi.ghx.com -> corex-int-db-audit01.awsdsi.ghx.com
imongo-02.awsdsi.ghx.com -> corex-int-db-audit02.awsdsi.ghx.com
imongo-03.awsdsi.ghx.com -> corex-int-db-audit03.awsdsi.ghx.com
smongo-01.awsdsi.ghx.com -> corex-stg-db-audit01.awsdsi.ghx.com
smongo-02.awsdsi.ghx.com -> corex-stg-db-audit02.awsdsi.ghx.com
smongo-03.awsdsi.ghx.com -> corex-stg-db-audit03.awsdsi.ghx.com
eb-execution-int-01.awsdsi.ghx.com -> moved to corex-int-db-audit01.awsdsi.ghx.com
eb-execution-int-02.awsdsi.ghx.com -> moved to corex-int-db-audit01.awsdsi.ghx.com
eb-execution-int-03.awsdsi.ghx.com -> moved to corex-int-db-audit01.awsdsi.ghx.com
eb-execution-stg01.awsdsi.ghx.com -> moved to corex-stg-db-audit01.awsdsi.ghx.com
event-bus-dev-01.awsdsi.ghx.com -> moved to corex-dev-db-audit01.awsdsi.ghx.com
event-bus-int-01.awsdsi.ghx.com -> moved to corex-int-db-audit01.awsdsi.ghx.com
event-bus-int-02.awsdsi.ghx.com -> moved to corex-int-db-audit01.awsdsi.ghx.com
event-bus-stg-01.awsdsi.ghx.com -> corex-stg-db-eb-config-server01.awsdsi.ghx.com
mongo-perftest-02.awsdsi.ghx.com N/A
mongo-perftest-03.awsdsi.ghx.com N/A
hatem-mongo-corex.awsdsi.ghx.com N/A



MetricAggregator s = NewRelic.getAgent().getMetricAggregator();
//String s1 = NewRelic.setInstanceName("CoreX-STG-db-eb-s1-01");
s.recordResponseTimeMetric("metrics", 10l);
System.out.println(">>>>"+);
/*
* MongoClientURI uri = new MongoClientURI(
* "mongodb+srv://spkannan:haripriya@event-bus-dev-sharded-cluster.mongodb.net/event-bus?replicaSet=rs01&ssl=false&connectTimeoutMS=100000"
* );
* MongoClient mongoClient = new MongoClient(uri); MongoDatabase database =
* mongoClient.getDatabase("event-bus"); System.out.println(">>>>>"+database);
*/
/*String command =
  "curl --user {cigztdwr}:{b68db372-6ff0-4e02-907a-534563785cde} --digest --header 'Accept: application/json' --include  --request GET https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/hosts/8b60c07e700a91ffa76592ab404e21ed/replicaset?retention=3600000";
ProcessBuilder processBuilder = new ProcessBuilder(command.split(" "));
processBuilder.directory(new File("/home/"));
Process process;*/
/*
* * try { process = processBuilder.start(); } catch (IOException e) { // TODO
* Auto-generated catch block e.printStackTrace(); }
* InputStream inputStream = process.getInputStream();
* System.out.println("input stream "+ inputStream); int exitCode =
* process.exitValue();
* process.destroy();
* String command1 =
* "curl -X POST https://postman-echo.com/post --data foo1=bar1&foo2=bar2"; try
* { Process process1 = Runtime.getRuntime().exec(command);
* System.out.println("input stream of runtime"+ process1.getOutputStream()); }
* catch (IOException e) { // TODO Auto-generated catch block
* e.printStackTrace(); }
*/
 
/*
try {
process = processBuilder.start();
BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream()));
StringBuilder builder = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
builder.append(line);
builder.append(System.getProperty("line.separator"));
}
String result = builder.toString();
System.out.print(result);

} catch (IOException e) {
System.out.print("error");
e.printStackTrace();
}
*/

/*
* String startURL = new StringBuilder().append(
* "https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/clusters/5d025aa2d54df78fc4fcfd60"
* ).toString(); try { HttpClient client = new DefaultHttpClient(); HttpGet
* request = new HttpGet(startURL); request. HttpResponse response =
* client.execute(request); BufferedReader rd = new BufferedReader (new
* InputStreamReader(response.getEntity().getContent())); String line = "";
* while ((line = rd.readLine()) != null) { System.out.println(line); } } catch
* (UnsupportedOperationException | IOException e) { // TODO Auto-generated
* catch block e.printStackTrace(); }
*/
/*
* HttpGet request = new HttpGet(
* "https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/clusters/5d025aa2d54df78fc4fcfd60"
* );
* CredentialsProvider provider = new BasicCredentialsProvider();
* provider.setCredentials( AuthScope.ANY, new
* UsernamePasswordCredentials("spkannan@ghx.com", "haripriya") );
* try (CloseableHttpClient httpClient = HttpClientBuilder.create()
* .setDefaultCredentialsProvider(provider) .build(); CloseableHttpResponse
* response = httpClient.execute(request)) {
* // 401 if wrong user/password
* System.out.println(response.getStatusLine().getStatusCode());
* org.apache.http.HttpEntity entity = response.getEntity(); if (entity != null)
* { // return it as a String String result;
* try { result = EntityUtils.toString(entity); System.out.println(result); }
* catch (ParseException | IOException e) { // TODO Auto-generated catch block
* e.printStackTrace(); } }
* } catch (ClientProtocolException e1) { // TODO Auto-generated catch block
* e1.printStackTrace(); } catch (IOException e1) { // TODO Auto-generated catch
* block e1.printStackTrace(); }
*/



String mms_public_key = "cigztdwr";
    String  mms_private_key = "b68db372-6ff0-4e02-907a-534563785cde";
    String myHost = "https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e/status/fixed-opcounters-query-chart?retention=3600000&bucketed=true&maxDataPoints=3000";
        System.out.println("Hello World");
           HttpClient client = new HttpClient();
        client.getState().setCredentials(
            AuthScope.ANY,
            new AutUsernamePasswordCredentials(mms_public_key, mms_private_key));
        // Suppose the site supports several authetication schemes: NTLM and Basic
        // Basic authetication is considered inherently insecure. Hence, NTLM authentication
        // is used per default
        // This is to make HttpClient pick the Basic authentication scheme over NTLM & Digest
        List authPrefs = new ArrayList(3);
        authPrefs.add(AuthPolicy.BASIC);
        authPrefs.add(AuthPolicy.NTLM);
        authPrefs.add(AuthPolicy.DIGEST);
        client.getParams().setParameter(AuthPolicy.AUTH_SCHEME_PRIORITY, authPrefs);
        GetMethod httpget = new GetMethod("https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/2d34dd3faf1cdc7a5a02bb6a9ba883c6/measurements?granularity=PT5M&period=PT10m");
        try {
            try {
int status = client.executeMethod(httpget);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
            // print the status and response
            System.out.println(httpget.getStatusLine());
            try {
System.out.println(httpget.getResponseBodyAsString());
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
        } finally {
            // release any connection resources used by the method
            httpget.releaseConnection();
        } 


curl --user "cigztdwr:b68db372-6ff0-4e02-907a-534563785cde" --digest \
 --header "Accept: application/json" \
 --include \
 --request GET "https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e/measurements?granularity=PT5M&period=PT10m"

https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e/measurements?granularity=PT5M&period=PT10m

https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/2d34dd3faf1cdc7a5a02bb6a9ba883c6/measurements?granularity=PT5M&period=PT10m

Cookie: mkjs_user_id=%225e9eeb8685757d602b10d301%22; mmsa-prod=7e9c87583e0bbd83332877689499117e-20200430;


https://cloud.mongodb.com/metrics/v1/groups/5373a8689194bf134f7a93ad/clusters/5d025aa2d54df78fc4fcfd60

https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/2d34dd3faf1cdc7a5a02bb6a9ba883c6/measurements?granularity=PT5M&period=PT10m

https://cloud.mongodb.com/deployment/5373a8689194bf134f7a93ad/host/4a071190e0434ff7adca2985c5b5437e

https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e/measurements?granularity=PT10S&start=2020-05-04T11:48:57Z&end=2020-05-04T11:56:37Z&m=OPERATIONS_SCAN_AND_ORDER&processId=CoreX-STG-db-eb-s1-01.awsdsi.ghx.com:27027&pretty=true



{
  "end": "2020-05-04T11:56:27Z",
  "granularity": "PT10S",
  "groupId": "5373a8689194bf134f7a93ad",
  "hostId": "4a071190e0434ff7adca2985c5b5437e",
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e/measurements?granularity=PT10S&start=2020-05-04T11:48:57Z&end=2020-05-04T11:56:37Z&m=OPERATIONS_SCAN_AND_ORDER&processId=CoreX-STG-db-eb-s1-01.awsdsi.ghx.com:27027&pretty=true",
      "rel": "self"
    },
    {
      "href": "https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e",
      "rel": "http://mms.mongodb.com/host"
    },
    {
      "href": "https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad",
      "rel": "http://mms.mongodb.com/group"
    }
  ],
  "measurements": [
    {
      "dataPoints": [
        {
          "timestamp": "2020-05-04T11:48:57Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T11:49:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T11:49:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:49:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:49:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:49:42Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T11:49:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:49:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:50:07Z",
          "value": 0.1000100010001
        },
        {
          "timestamp": "2020-05-04T11:50:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:50:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:50:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:50:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:50:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:51:02Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T11:51:07Z",
          "value": 0.09998000399920015
        },
        {
          "timestamp": "2020-05-04T11:51:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:51:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:51:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:51:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:51:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:52:07Z",
          "value": 0.09991008092716555
        },
        {
          "timestamp": "2020-05-04T11:52:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:52:22Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T11:52:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:52:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:52:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:52:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:53:02Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T11:53:07Z",
          "value": 0.09999000099990002
        },
        {
          "timestamp": "2020-05-04T11:53:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:53:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:53:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:53:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:53:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:54:07Z",
          "value": 0.09999000099990002
        },
        {
          "timestamp": "2020-05-04T11:54:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:54:22Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T11:54:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:54:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:54:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:54:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:55:07Z",
          "value": 0.09999000099990002
        },
        {
          "timestamp": "2020-05-04T11:55:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:55:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:55:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:55:42Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T11:55:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:55:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:56:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T11:56:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T11:56:27Z",
          "value": 0.0
        }
      ],
      "name": "OPERATIONS_SCAN_AND_ORDER",
      "units": "SCALAR_PER_SECOND"
    }
  ],
  "processId": "CoreX-STG-db-eb-s1-01.awsdsi.ghx.com:27027",
  "start": "2020-05-04T11:48:57Z"
}

https://docs.cloudmanager.mongodb.com/reference/api/measures/get-database-measurements/

{
  "end": "2020-05-04T13:14:27Z",
  "granularity": "PT10S",
  "groupId": "5373a8689194bf134f7a93ad",
  "hostId": "4a071190e0434ff7adca2985c5b5437e",
  "links": [
    {
      "href": "https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e/measurements?granularity=PT10S&start=2020-05-04T12:48:57Z&end=2020-05-04T13:15:37Z&m=OPERATIONS_SCAN_AND_ORDER&processId=CoreX-STG-db-eb-s1-01.awsdsi.ghx.com:27027&pretty=true",
      "rel": "self"
    },
    {
      "href": "https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e",
      "rel": "http://mms.mongodb.com/host"
    },
    {
      "href": "https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad",
      "rel": "http://mms.mongodb.com/group"
    }
  ],
  "measurements": [
    {
      "dataPoints": [
        {
          "timestamp": "2020-05-04T12:48:57Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T12:49:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T12:49:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:49:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:49:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:49:42Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T12:49:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:49:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:50:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T12:50:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:50:22Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T12:50:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:50:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:50:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:50:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:51:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T12:51:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:51:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:51:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:51:42Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T12:51:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:51:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:52:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T12:52:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:52:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:52:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:52:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:52:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:53:02Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T12:53:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T12:53:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:53:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:53:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:53:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:53:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:54:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T12:54:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:54:22Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T12:54:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:54:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:54:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:54:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:55:02Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T12:55:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T12:55:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:55:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:55:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:55:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:55:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:56:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T12:56:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:56:22Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T12:56:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:56:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:56:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:56:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:57:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T12:57:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:57:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:57:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:57:42Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T12:57:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:57:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:58:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T12:58:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:58:22Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T12:58:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:58:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:58:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:58:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:59:07Z",
          "value": 0.09999000099990002
        },
        {
          "timestamp": "2020-05-04T12:59:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:59:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:59:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:59:42Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T12:59:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T12:59:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:00:07Z",
          "value": 0.09985022466300549
        },
        {
          "timestamp": "2020-05-04T13:00:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:00:22Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:00:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:00:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:00:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:00:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:01:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T13:01:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:01:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:01:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:01:42Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:01:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:01:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:02:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T13:02:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:02:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:02:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:02:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:02:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:03:02Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:03:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T13:03:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:03:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:03:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:03:42Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:03:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:03:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:04:07Z",
          "value": 0.1000100010001
        },
        {
          "timestamp": "2020-05-04T13:04:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:04:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:04:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:04:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:04:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:05:02Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:05:07Z",
          "value": 0.10005002501250626
        },
        {
          "timestamp": "2020-05-04T13:05:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:05:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:05:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:05:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:05:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:06:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T13:06:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:06:23Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:06:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:06:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:06:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:06:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:07:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T13:07:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:07:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:07:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:07:42Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:07:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:07:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:08:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T13:08:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:08:22Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:08:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:08:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:08:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:08:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:09:07Z",
          "value": 0.09999000099990002
        },
        {
          "timestamp": "2020-05-04T13:09:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:09:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:09:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:09:42Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:09:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:09:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:10:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T13:10:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:10:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:10:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:10:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:10:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:11:02Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:11:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T13:11:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:11:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:11:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:11:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:11:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:12:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T13:12:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:12:22Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:12:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:12:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:12:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:12:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:13:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T13:13:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:13:27Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:13:37Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:13:42Z",
          "value": null
        },
        {
          "timestamp": "2020-05-04T13:13:47Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:13:57Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:14:07Z",
          "value": 0.1
        },
        {
          "timestamp": "2020-05-04T13:14:17Z",
          "value": 0.0
        },
        {
          "timestamp": "2020-05-04T13:14:27Z",
          "value": 0.0
        }
      ],
      "name": "OPERATIONS_SCAN_AND_ORDER",
      "units": "SCALAR_PER_SECOND"
    }
  ],
  "processId": "CoreX-STG-db-eb-s1-01.awsdsi.ghx.com:27027",
  "start": "2020-05-04T12:48:57Z"
}

curl -X GET "https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com/dev-cpu-utilization_all/_search?pretty=true"

curl -X GET "https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_search?pretty=true"

curl -X GET "https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{"query": {
"bool": {
    "must":{"match_all":{}},
    "filter":{"bool":{
      "must" : [{
        "range" : {
          "@timestamp" : { "gte" : "2020-04-30T06:07:49.337Z",
          "lte" : "2020-04-30T06:27:09.543Z" }
        }}
,{"term":{"application":"DEV-processing-engine"}}
],"must_not":[{ "range": { "user_p": { "lte": 0 } } }]}}}},"size":0,
    "aggs" : {
        "output":{
            "date_histogram" : {
                "field" : "@timestamp",
                "interval" : "2m",
                "time_zone":"+05:30",
                "min_doc_count":1,
"extended_bounds":{
"min":"2020-04-30T06:07:49.337Z",
"max":"2020-04-30T06:27:09.543Z"
            }},"aggs":{
"items":{"terms":{"field":"hostname","size":100,
"order":{"count":"desc"}},
"aggs":{"count":{"avg":{"field":"user_p"}}}}}}
        }
}'


romDate=2020-04-30T06:07:49.337Z&interval=1m&testResultId=5eaa6ad099687c5311c12267&toDate=2020-04-30T06:27:09.543Z&viewType=chart

,{
label: "for cloud Mongo Metrics",
name: 'Listener Event Frequency',
checked: false,
view: 'chart',
chartType: 'lineChart',
group: 'eventbusdao',
yAxisLabel: 'Average Duration (ms)',
description: localization.get('testframework.performanceMetricsReports.ListenerEventFrequencyDescription'),
filter: false,
formatType: 'default',
}



import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.TimeZone;

import org.apache.http.Header;
import org.apache.http.HttpResponse;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.Credentials;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClientBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;
import org.json.JSONException;
import org.json.JSONObject;

public class Test{

     public static void main(String []args){
    String mms_public_key = "cigztdwr";
    String  mms_private_key = "b68db372-6ff0-4e02-907a-534563785cde";
    String myHost = "https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e/measurements?granularity=PT10S&start=2020-05-04T11:48:57Z&end=2020-05-04T11:56:37Z&m=OPERATIONS_SCAN_AND_ORDER&processId=CoreX-STG-db-eb-s1-01.awsdsi.ghx.com:27027&pretty=true";
   
      HttpGet request = new HttpGet(myHost);
      
      CredentialsProvider provider = new BasicCredentialsProvider();
      provider.setCredentials(AuthScope.ANY, new
      UsernamePasswordCredentials(mms_public_key, mms_private_key) );
        String result = null;

      try (CloseableHttpClient httpClient = HttpClientBuilder.create()
      .setDefaultCredentialsProvider(provider) .build(); 
      CloseableHttpResponse
      response = httpClient.execute(request)) {
      
      // 401 if wrong user/password
      System.out.println(response.getStatusLine().getStatusCode());
      
      org.apache.http.HttpEntity entity = response.getEntity();
    System.out.println(entity);
    InputStream instream = entity.getContent();
                result = convertStreamToString(instream);
                
    JSONObject myObject = new JSONObject(result);
    System.out.println(myObject);
     
     
      List<String> timeZones = new ArrayList<String>();
            String ISTDateString = "";
            SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
            sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
            String utcTime = sdf.format(new Date());
            System.err.println("utcTime: " + utcTime);
            sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
            String pattern = "dd-MM-yyyy HH:mm:ss";
            SimpleDateFormat formatter;
            formatter = new SimpleDateFormat(pattern);
            try {
                Date ISTDate = sdf.parse(utcTime);
                ISTDateString = formatter.format(ISTDate);
                timeZones.add(utcTime+ ","+ ISTDateString);
            } catch(Exception e) {
                e.printStackTrace();
            }

            for(String i: timeZones) {
                System.out.println(i);
            }

      
      } catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (JSONException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
     }
     
     private static String convertStreamToString(InputStream is) {

        BufferedReader reader = new BufferedReader(new InputStreamReader(is));
        StringBuilder sb = new StringBuilder();

        String line = null;
        try {
            while ((line = reader.readLine()) != null) {
                sb.append(line + "\n");
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            try {
                is.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return sb.toString();
    }
}


https://corex-stg.awsdsi.ghx.com/rest/testframework/performance/metrics/newrelic?chartGroup=osdao&chartName=Cumulative+CPU+Utilization&filterType=corex-es&fromDate=2020-04-30T06:07:49.337Z&interval=1m&testResultId=5eaa6ad099687c5311c12267&toDate=2020-04-30T06:27:09.543Z&viewType=chart


https://corex-stg.awsdsi.ghx.com/rest/testframework/performance/metrics/newrelic?chartGroup=osdao&chartName=Cumulative+CPU+Utilization&filterType=CoreX-STG-db-audit-02&fromDate=2020-04-30T06:07:49.337Z&interval=1m&testResultId=5eaa6ad099687c5311c12267&toDate=2020-04-30T06:27:09.543Z&viewType=chart

https://corex-stg.awsdsi.ghx.com/rest/testframework/performance/metrics/newrelic?chartGroup=osdao&chartName=Cumulative+CPU+Utilization&filterType=STG-processing-engine&fromDate=2020-04-30T06:07:49.337Z&interval=1m&testResultId=5eaa6ad099687c5311c12267&toDate=2020-04-30T06:27:09.543Z&viewType=chart


{"processId":"CoreX-STG-db-eb-s1-01.awsdsi.ghx.com:27027","granularity":"PT10S","groupId":"5373a8689194bf134f7a93ad","start":"2020-05-04T11:48:57Z","hostId":"4a071190e0434ff7adca2985c5b5437e","end":"2020-05-04T11:56:27Z","links":[{"rel":"self","href":"https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e/measurements?granularity=PT10S&start=2020-05-04T11:48:57Z&end=2020-05-04T11:56:37Z&m=OPERATIONS_SCAN_AND_ORDER&processId=CoreX-STG-db-eb-s1-01.awsdsi.ghx.com:27027&pretty=true"},{"rel":"http://mms.mongodb.com/host","href":"https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e"},{"rel":"http://mms.mongodb.com/group","href":"https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad"}],


"measurements":[{"name":"OPERATIONS_SCAN_AND_ORDER","dataPoints":[{"value":null,"timestamp":"2020-05-04T11:48:57Z"},{"value":0.1,"timestamp":"2020-05-04T11:49:07Z"},{"value":0,"timestamp":"2020-05-04T11:49:17Z"},{"value":0,"timestamp":"2020-05-04T11:49:27Z"},{"value":0,"timestamp":"2020-05-04T11:49:37Z"},{"value":null,"timestamp":"2020-05-04T11:49:42Z"},{"value":0,"timestamp":"2020-05-04T11:49:47Z"},{"value":0,"timestamp":"2020-05-04T11:49:57Z"},{"value":0.1000100010001,"timestamp":"2020-05-04T11:50:07Z"},{"value":0,"timestamp":"2020-05-04T11:50:17Z"},{"value":0,"timestamp":"2020-05-04T11:50:27Z"},{"value":0,"timestamp":"2020-05-04T11:50:37Z"},{"value":0,"timestamp":"2020-05-04T11:50:47Z"},{"value":0,"timestamp":"2020-05-04T11:50:57Z"},{"value":null,"timestamp":"2020-05-04T11:51:02Z"},{"value":0.09998000399920015,"timestamp":"2020-05-04T11:51:07Z"},{"value":0,"timestamp":"2020-05-04T11:51:17Z"},{"value":0,"timestamp":"2020-05-04T11:51:27Z"},{"value":0,"timestamp":"2020-05-04T11:51:37Z"},{"value":0,"timestamp":"2020-05-04T11:51:47Z"},{"value":0,"timestamp":"2020-05-04T11:51:57Z"},{"value":0.09991008092716555,"timestamp":"2020-05-04T11:52:07Z"},{"value":0,"timestamp":"2020-05-04T11:52:17Z"},{"value":null,"timestamp":"2020-05-04T11:52:22Z"},{"value":0,"timestamp":"2020-05-04T11:52:27Z"},{"value":0,"timestamp":"2020-05-04T11:52:37Z"},{"value":0,"timestamp":"2020-05-04T11:52:47Z"},{"value":0,"timestamp":"2020-05-04T11:52:57Z"},{"value":null,"timestamp":"2020-05-04T11:53:02Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:53:07Z"},{"value":0,"timestamp":"2020-05-04T11:53:17Z"},{"value":0,"timestamp":"2020-05-04T11:53:27Z"},{"value":0,"timestamp":"2020-05-04T11:53:37Z"},{"value":0,"timestamp":"2020-05-04T11:53:47Z"},{"value":0,"timestamp":"2020-05-04T11:53:57Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:54:07Z"},{"value":0,"timestamp":"2020-05-04T11:54:17Z"},{"value":null,"timestamp":"2020-05-04T11:54:22Z"},{"value":0,"timestamp":"2020-05-04T11:54:27Z"},{"value":0,"timestamp":"2020-05-04T11:54:37Z"},{"value":0,"timestamp":"2020-05-04T11:54:47Z"},{"value":0,"timestamp":"2020-05-04T11:54:57Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:55:07Z"},{"value":0,"timestamp":"2020-05-04T11:55:17Z"},{"value":0,"timestamp":"2020-05-04T11:55:27Z"},{"value":0,"timestamp":"2020-05-04T11:55:37Z"},{"value":null,"timestamp":"2020-05-04T11:55:42Z"},{"value":0,"timestamp":"2020-05-04T11:55:47Z"},{"value":0,"timestamp":"2020-05-04T11:55:57Z"},{"value":0.1,"timestamp":"2020-05-04T11:56:07Z"},{"value":0,"timestamp":"2020-05-04T11:56:17Z"},{"value":0,"timestamp":"2020-05-04T11:56:27Z"}],"units":"SCALAR_PER_SECOND"}]}




>>>>>>>s[{"name":"OPERATIONS_SCAN_AND_ORDER","dataPoints":[{"value":null,"timestamp":"2020-05-04T11:48:57Z"},{"value":0.1,"timestamp":"2020-05-04T11:49:07Z"},{"value":0,"timestamp":"2020-05-04T11:49:17Z"},{"value":0,"timestamp":"2020-05-04T11:49:27Z"},{"value":0,"timestamp":"2020-05-04T11:49:37Z"},{"value":null,"timestamp":"2020-05-04T11:49:42Z"},{"value":0,"timestamp":"2020-05-04T11:49:47Z"},{"value":0,"timestamp":"2020-05-04T11:49:57Z"},{"value":0.1000100010001,"timestamp":"2020-05-04T11:50:07Z"},{"value":0,"timestamp":"2020-05-04T11:50:17Z"},{"value":0,"timestamp":"2020-05-04T11:50:27Z"},{"value":0,"timestamp":"2020-05-04T11:50:37Z"},{"value":0,"timestamp":"2020-05-04T11:50:47Z"},{"value":0,"timestamp":"2020-05-04T11:50:57Z"},{"value":null,"timestamp":"2020-05-04T11:51:02Z"},{"value":0.09998000399920015,"timestamp":"2020-05-04T11:51:07Z"},{"value":0,"timestamp":"2020-05-04T11:51:17Z"},{"value":0,"timestamp":"2020-05-04T11:51:27Z"},{"value":0,"timestamp":"2020-05-04T11:51:37Z"},{"value":0,"timestamp":"2020-05-04T11:51:47Z"},{"value":0,"timestamp":"2020-05-04T11:51:57Z"},{"value":0.09991008092716555,"timestamp":"2020-05-04T11:52:07Z"},{"value":0,"timestamp":"2020-05-04T11:52:17Z"},{"value":null,"timestamp":"2020-05-04T11:52:22Z"},{"value":0,"timestamp":"2020-05-04T11:52:27Z"},{"value":0,"timestamp":"2020-05-04T11:52:37Z"},{"value":0,"timestamp":"2020-05-04T11:52:47Z"},{"value":0,"timestamp":"2020-05-04T11:52:57Z"},{"value":null,"timestamp":"2020-05-04T11:53:02Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:53:07Z"},{"value":0,"timestamp":"2020-05-04T11:53:17Z"},{"value":0,"timestamp":"2020-05-04T11:53:27Z"},{"value":0,"timestamp":"2020-05-04T11:53:37Z"},{"value":0,"timestamp":"2020-05-04T11:53:47Z"},{"value":0,"timestamp":"2020-05-04T11:53:57Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:54:07Z"},{"value":0,"timestamp":"2020-05-04T11:54:17Z"},{"value":null,"timestamp":"2020-05-04T11:54:22Z"},{"value":0,"timestamp":"2020-05-04T11:54:27Z"},{"value":0,"timestamp":"2020-05-04T11:54:37Z"},{"value":0,"timestamp":"2020-05-04T11:54:47Z"},{"value":0,"timestamp":"2020-05-04T11:54:57Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:55:07Z"},{"value":0,"timestamp":"2020-05-04T11:55:17Z"},{"value":0,"timestamp":"2020-05-04T11:55:27Z"},{"value":0,"timestamp":"2020-05-04T11:55:37Z"},{"value":null,"timestamp":"2020-05-04T11:55:42Z"},{"value":0,"timestamp":"2020-05-04T11:55:47Z"},{"value":0,"timestamp":"2020-05-04T11:55:57Z"},{"value":0.1,"timestamp":"2020-05-04T11:56:07Z"},{"value":0,"timestamp":"2020-05-04T11:56:17Z"},{"value":0,"timestamp":"2020-05-04T11:56:27Z"}],"units":"SCALAR_PER_SECOND"}]



First: {"name":"OPERATIONS_SCAN_AND_ORDER","dataPoints":[{"value":null,"timestamp":"2020-05-04T11:48:57Z"},{"value":0.1,"timestamp":"2020-05-04T11:49:07Z"},{"value":0,"timestamp":"2020-05-04T11:49:17Z"},{"value":0,"timestamp":"2020-05-04T11:49:27Z"},{"value":0,"timestamp":"2020-05-04T11:49:37Z"},{"value":null,"timestamp":"2020-05-04T11:49:42Z"},{"value":0,"timestamp":"2020-05-04T11:49:47Z"},{"value":0,"timestamp":"2020-05-04T11:49:57Z"},{"value":0.1000100010001,"timestamp":"2020-05-04T11:50:07Z"},{"value":0,"timestamp":"2020-05-04T11:50:17Z"},{"value":0,"timestamp":"2020-05-04T11:50:27Z"},{"value":0,"timestamp":"2020-05-04T11:50:37Z"},{"value":0,"timestamp":"2020-05-04T11:50:47Z"},{"value":0,"timestamp":"2020-05-04T11:50:57Z"},{"value":null,"timestamp":"2020-05-04T11:51:02Z"},{"value":0.09998000399920015,"timestamp":"2020-05-04T11:51:07Z"},{"value":0,"timestamp":"2020-05-04T11:51:17Z"},{"value":0,"timestamp":"2020-05-04T11:51:27Z"},{"value":0,"timestamp":"2020-05-04T11:51:37Z"},{"value":0,"timestamp":"2020-05-04T11:51:47Z"},{"value":0,"timestamp":"2020-05-04T11:51:57Z"},{"value":0.09991008092716555,"timestamp":"2020-05-04T11:52:07Z"},{"value":0,"timestamp":"2020-05-04T11:52:17Z"},{"value":null,"timestamp":"2020-05-04T11:52:22Z"},{"value":0,"timestamp":"2020-05-04T11:52:27Z"},{"value":0,"timestamp":"2020-05-04T11:52:37Z"},{"value":0,"timestamp":"2020-05-04T11:52:47Z"},{"value":0,"timestamp":"2020-05-04T11:52:57Z"},{"value":null,"timestamp":"2020-05-04T11:53:02Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:53:07Z"},{"value":0,"timestamp":"2020-05-04T11:53:17Z"},{"value":0,"timestamp":"2020-05-04T11:53:27Z"},{"value":0,"timestamp":"2020-05-04T11:53:37Z"},{"value":0,"timestamp":"2020-05-04T11:53:47Z"},{"value":0,"timestamp":"2020-05-04T11:53:57Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:54:07Z"},{"value":0,"timestamp":"2020-05-04T11:54:17Z"},{"value":null,"timestamp":"2020-05-04T11:54:22Z"},{"value":0,"timestamp":"2020-05-04T11:54:27Z"},{"value":0,"timestamp":"2020-05-04T11:54:37Z"},{"value":0,"timestamp":"2020-05-04T11:54:47Z"},{"value":0,"timestamp":"2020-05-04T11:54:57Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:55:07Z"},{"value":0,"timestamp":"2020-05-04T11:55:17Z"},{"value":0,"timestamp":"2020-05-04T11:55:27Z"},{"value":0,"timestamp":"2020-05-04T11:55:37Z"},{"value":null,"timestamp":"2020-05-04T11:55:42Z"},{"value":0,"timestamp":"2020-05-04T11:55:47Z"},{"value":0,"timestamp":"2020-05-04T11:55:57Z"},{"value":0.1,"timestamp":"2020-05-04T11:56:07Z"},{"value":0,"timestamp":"2020-05-04T11:56:17Z"},{"value":0,"timestamp":"2020-05-04T11:56:27Z"}],"units":"SCALAR_PER_SECOND"}


[{"value":null,"timestamp":"2020-05-04T11:48:57Z"},{"value":0.1,"timestamp":"2020-05-04T11:49:07Z"},{"value":0,"timestamp":"2020-05-04T11:49:17Z"},{"value":0,"timestamp":"2020-05-04T11:49:27Z"},{"value":0,"timestamp":"2020-05-04T11:49:37Z"},{"value":null,"timestamp":"2020-05-04T11:49:42Z"},{"value":0,"timestamp":"2020-05-04T11:49:47Z"},{"value":0,"timestamp":"2020-05-04T11:49:57Z"},{"value":0.1000100010001,"timestamp":"2020-05-04T11:50:07Z"},{"value":0,"timestamp":"2020-05-04T11:50:17Z"},{"value":0,"timestamp":"2020-05-04T11:50:27Z"},{"value":0,"timestamp":"2020-05-04T11:50:37Z"},{"value":0,"timestamp":"2020-05-04T11:50:47Z"},{"value":0,"timestamp":"2020-05-04T11:50:57Z"},{"value":null,"timestamp":"2020-05-04T11:51:02Z"},{"value":0.09998000399920015,"timestamp":"2020-05-04T11:51:07Z"},{"value":0,"timestamp":"2020-05-04T11:51:17Z"},{"value":0,"timestamp":"2020-05-04T11:51:27Z"},{"value":0,"timestamp":"2020-05-04T11:51:37Z"},{"value":0,"timestamp":"2020-05-04T11:51:47Z"},{"value":0,"timestamp":"2020-05-04T11:51:57Z"},{"value":0.09991008092716555,"timestamp":"2020-05-04T11:52:07Z"},{"value":0,"timestamp":"2020-05-04T11:52:17Z"},{"value":null,"timestamp":"2020-05-04T11:52:22Z"},{"value":0,"timestamp":"2020-05-04T11:52:27Z"},{"value":0,"timestamp":"2020-05-04T11:52:37Z"},{"value":0,"timestamp":"2020-05-04T11:52:47Z"},{"value":0,"timestamp":"2020-05-04T11:52:57Z"},{"value":null,"timestamp":"2020-05-04T11:53:02Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:53:07Z"},{"value":0,"timestamp":"2020-05-04T11:53:17Z"},{"value":0,"timestamp":"2020-05-04T11:53:27Z"},{"value":0,"timestamp":"2020-05-04T11:53:37Z"},{"value":0,"timestamp":"2020-05-04T11:53:47Z"},{"value":0,"timestamp":"2020-05-04T11:53:57Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:54:07Z"},{"value":0,"timestamp":"2020-05-04T11:54:17Z"},{"value":null,"timestamp":"2020-05-04T11:54:22Z"},{"value":0,"timestamp":"2020-05-04T11:54:27Z"},{"value":0,"timestamp":"2020-05-04T11:54:37Z"},{"value":0,"timestamp":"2020-05-04T11:54:47Z"},{"value":0,"timestamp":"2020-05-04T11:54:57Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:55:07Z"},{"value":0,"timestamp":"2020-05-04T11:55:17Z"},{"value":0,"timestamp":"2020-05-04T11:55:27Z"},{"value":0,"timestamp":"2020-05-04T11:55:37Z"},{"value":null,"timestamp":"2020-05-04T11:55:42Z"},{"value":0,"timestamp":"2020-05-04T11:55:47Z"},{"value":0,"timestamp":"2020-05-04T11:55:57Z"},{"value":0.1,"timestamp":"2020-05-04T11:56:07Z"},{"value":0,"timestamp":"2020-05-04T11:56:17Z"},{"value":0,"timestamp":"2020-05-04T11:56:27Z"}]


[{"value":null,"timestamp":"2020-05-04T11:48:57Z"},{"value":0.1,"timestamp":"2020-05-04T11:49:07Z"},{"value":0,"timestamp":"2020-05-04T11:49:17Z"},{"value":0,"timestamp":"2020-05-04T11:49:27Z"},{"value":0,"timestamp":"2020-05-04T11:49:37Z"},{"value":null,"timestamp":"2020-05-04T11:49:42Z"},{"value":0,"timestamp":"2020-05-04T11:49:47Z"},{"value":0,"timestamp":"2020-05-04T11:49:57Z"},{"value":0.1000100010001,"timestamp":"2020-05-04T11:50:07Z"},{"value":0,"timestamp":"2020-05-04T11:50:17Z"},{"value":0,"timestamp":"2020-05-04T11:50:27Z"},{"value":0,"timestamp":"2020-05-04T11:50:37Z"},{"value":0,"timestamp":"2020-05-04T11:50:47Z"},{"value":0,"timestamp":"2020-05-04T11:50:57Z"},{"value":null,"timestamp":"2020-05-04T11:51:02Z"},{"value":0.09998000399920015,"timestamp":"2020-05-04T11:51:07Z"},{"value":0,"timestamp":"2020-05-04T11:51:17Z"},{"value":0,"timestamp":"2020-05-04T11:51:27Z"},{"value":0,"timestamp":"2020-05-04T11:51:37Z"},{"value":0,"timestamp":"2020-05-04T11:51:47Z"},{"value":0,"timestamp":"2020-05-04T11:51:57Z"},{"value":0.09991008092716555,"timestamp":"2020-05-04T11:52:07Z"},{"value":0,"timestamp":"2020-05-04T11:52:17Z"},{"value":null,"timestamp":"2020-05-04T11:52:22Z"},{"value":0,"timestamp":"2020-05-04T11:52:27Z"},{"value":0,"timestamp":"2020-05-04T11:52:37Z"},{"value":0,"timestamp":"2020-05-04T11:52:47Z"},{"value":0,"timestamp":"2020-05-04T11:52:57Z"},{"value":null,"timestamp":"2020-05-04T11:53:02Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:53:07Z"},{"value":0,"timestamp":"2020-05-04T11:53:17Z"},{"value":0,"timestamp":"2020-05-04T11:53:27Z"},{"value":0,"timestamp":"2020-05-04T11:53:37Z"},{"value":0,"timestamp":"2020-05-04T11:53:47Z"},{"value":0,"timestamp":"2020-05-04T11:53:57Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:54:07Z"},{"value":0,"timestamp":"2020-05-04T11:54:17Z"},{"value":null,"timestamp":"2020-05-04T11:54:22Z"},{"value":0,"timestamp":"2020-05-04T11:54:27Z"},{"value":0,"timestamp":"2020-05-04T11:54:37Z"},{"value":0,"timestamp":"2020-05-04T11:54:47Z"},{"value":0,"timestamp":"2020-05-04T11:54:57Z"},{"value":0.09999000099990002,"timestamp":"2020-05-04T11:55:07Z"},{"value":0,"timestamp":"2020-05-04T11:55:17Z"},{"value":0,"timestamp":"2020-05-04T11:55:27Z"},{"value":0,"timestamp":"2020-05-04T11:55:37Z"},{"value":null,"timestamp":"2020-05-04T11:55:42Z"},{"value":0,"timestamp":"2020-05-04T11:55:47Z"},{"value":0,"timestamp":"2020-05-04T11:55:57Z"},{"value":0.1,"timestamp":"2020-05-04T11:56:07Z"},{"value":0,"timestamp":"2020-05-04T11:56:17Z"},{"value":0,"timestamp":"2020-05-04T11:56:27Z"}]



http://localhost:8080/ui-heimdall/rest/testframework/performance/metrics/?chartGroup=cloudmongoeventscanandorder&chartName=Average+Scan+and+order+of+EventBus&filterType=All&fromDate=2018-03-20T06:03:47.692Z&interval=1m&testResultId=5ab0a3e05146940b413ddb68&toDate=2018-03-20T06:26:44.101Z&viewType=chart





http://localhost:8080/ui-heimdall/rest/testframework/performance/metrics/?chartGroup=tpmdao&chartName=TPM-DAO-methodlevel+responsetime&filterType=All&fromDate=2018-03-20T06:03:47.692Z&interval=1m&testResultId=5ab0a3e05146940b413ddb68&toDate=2018-03-20T06:26:44.101Z&viewType=chart




public static Map<String, Object> getCloudMongoEventScanAndOrder() {
String mms_public_key = "cigztdwr";
String mms_private_key = "b68db372-6ff0-4e02-907a-534563785cde";
String myHost = "https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e/measurements?granularity=PT10S&start=2020-05-05T12:48:57Z&end=2020-05-05T13:15:37Z&m=OPERATIONS_SCAN_AND_ORDER&processId=CoreX-STG-db-eb-s1-01.awsdsi.ghx.com:27027&pretty=true";
Map<String, Object> outputResult = Maps.newHashMap();
HttpGet request = new HttpGet(myHost);

CredentialsProvider provider = new BasicCredentialsProvider();
provider.setCredentials(AuthScope.ANY, new UsernamePasswordCredentials(mms_public_key, mms_private_key));
String result = null;

try (CloseableHttpClient httpClient = HttpClientBuilder.create().setDefaultCredentialsProvider(provider)
.build(); CloseableHttpResponse response = httpClient.execute(request)) {

// 401 if wrong user/password
System.out.println(response.getStatusLine().getStatusCode());

org.apache.http.HttpEntity entity = response.getEntity();
System.out.println(entity);
InputStream instream = entity.getContent();
result = convertStreamToString(instream);

System.out.println(">>result"+result);
ScanAndOrder scn = new ObjectMapper().readValue(result, ScanAndOrder.class);
System.out.println("scnscnscnscn"+scn);
//ArrayList ListOfmap = scn.getDataPoints();
System.out.println("VVVVVVVVVVVVVVVVVVVVVVV"+scn.getMeasurements().get(0));
Map map = (Map) scn.getMeasurements().get(0);

System.out.println("dpdpdpdp"+map.get("dataPoints"));
ArrayList<Map> dptlist =  (ArrayList<Map>) map.get("dataPoints");
System.out.println("??????????????????"+dptlist);
System.out.println("dptlistdptlistdptlistdptlist"+dptlist.get(0));
//DataPointOfScanAndOrder s =dptlist.get(0);
//System.out.println(s);
for(Map dp: dptlist) {
System.out.println("SSSSSSSSSS"+dp);
//DataPointOfScanAndOrder dpscn = (DataPointOfScanAndOrder) dp;
System.out.println("key"+dp.keySet()+"value"+dp.values());
if(dp.get("value") == null) {
outputResult.put(dp.get("timestamp").toString(), (Object)"0");
}else {
outputResult.put(dp.get("timestamp").toString(), (Object)dp.get("value").toString());
}
//System.out.println("KEY"+dp.get("timestamp").toString()+"Val"+dp.get("value").toString());
//outputResult.put(dp.get("timestamp").toString(), dp.get("value").toString());
}
/*
* for(int i=0; i<dptlist.size();i++) {
* System.out.println(dptlist.get(i)); String key =
* dptlist.get(i).getTimestamp(); String val = dptlist.get(i).getValue();
* System.out.println("KEY"+key+"Val"+val);
* //outputResult.put(dptlist.get(i).getValue().toString(),
* dptlist.get(i).getTimestamp()); }
*/
/*
* for(DataPointOfScanAndOrder dpt: dptlist.get(0)) {
* System.out.println("dptdptdptdpt"+dpt);
* }
*/
//scn.setDataPoints(scn.getMeasurements().get(0));
//System.out.println(scn.getDataPoints().get(0).getTimestamp());
/*
Object myObject = result;
  ArrayList list = (ArrayList) myObject;
  System.out.println("??????????????????"+list);*/
 
/*
* org.json.JSONObject myObject = new org.json.JSONObject(result);
* JsonObject resultObject = new JsonObject(); JsonObject responseHits =
* (JsonObject) resultObject.get("measurements");
* System.out.println("responseHits"+responseHits);
* System.out.println(myObject); int FIRST_ELEMENT = 0; org.json.JSONObject obj
* = new org.json.JSONObject(); org.json.JSONArray json = (org.json.JSONArray)
* myObject.get("measurements"); if (json.length() > 0) {
* System.out.println("First: " + json.getJSONObject(FIRST_ELEMENT).toString());
* obj = json.getJSONObject(FIRST_ELEMENT); }
* System.out.println(obj.get("dataPoints").toString()); org.json.JSONArray
* valueWithTimeStamp = (org.json.JSONArray) obj.get("dataPoints"); // for(int
* i=0; i<valueWithTimeStamp.length(); i++) {
* System.out.println("vvv"+valueWithTimeStamp.get(i)); org.json.JSONObject
* containingMap = (org.json.JSONObject) valueWithTimeStamp.get(i);
*/
//JsonElement obj1 = (JsonElement) valueWithTimeStamp.get(i);
 
/*
* //toMap(obj); Map<String, Object> mapObj = new Gson().fromJson( obj1, new
* TypeToken<HashMap<String, Object>>() {}.getType() );
* System.out.println("mapObjmapObjmapObj"+mapObj);
*/
// }
 
//ArrayList list =new ObjectMapper().readValue(result, ArrayList.class);
 
//System.out.println(">>>>>>"+list);
 
/*  for (JsonElement element :valueWithTimeStamp ) { JsonObject jsonObj =
  element.getAsJsonObject(); String key = jsonObj.get(KEY).getAsString();
  String value = jsonObj.get(VALUE).getAsString(); }*/
 
/*
* map.entrySet().stream().forEach(entry -> { outputResult.put(entry.getKey(),
* entry.getValue()); });
*/
 
System.out.println(">>>>>>>map" + outputResult);
List<String> timeZones = new ArrayList<String>();
String ISTDateString = "";
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy HH:mm:ss");
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
String utcTime = sdf.format(new Date());
// System.err.println("utcTime: " + utcTime);
sdf.setTimeZone(TimeZone.getTimeZone("UTC"));
String pattern = "dd-MM-yyyy HH:mm:ss";
SimpleDateFormat formatter;
formatter = new SimpleDateFormat(pattern);
try {
Date ISTDate = sdf.parse(utcTime);
ISTDateString = formatter.format(ISTDate);
timeZones.add(utcTime + "," + ISTDateString);
} catch (Exception e) {
e.printStackTrace();
}

for (String i : timeZones) {
System.out.println(i);
}

} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} /*
* catch (JSONException e1) { // TODO Auto-generated catch block
* e1.printStackTrace(); }
*/
return outputResult;
}

private static String convertStreamToString(InputStream is) {

BufferedReader reader = new BufferedReader(new InputStreamReader(is));
StringBuilder sb = new StringBuilder();

String line = null;
try {
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
is.close();
} catch (IOException e) {
e.printStackTrace();
}
}
return sb.toString();
}

/*
* public static Map<String, Object> toMap(JSONObject object) throws
* JSONException { Map<String, Object> map = new HashMap<String, Object>();
* Iterator<String> keysItr = object.keys(); while(keysItr.hasNext()) { String
* key = keysItr.next(); Object value = object.get(key);
* if(value instanceof JSONArray) { value = toList((JSONArray) value); }
* else if(value instanceof JSONObject) { value = toMap((JSONObject) value); }
* map.put(key, value); } return map; }
*/
/*
* public static Map<String, Object> toMap(JSONObject object) throws
* JSONException { Map<String, Object> map = new HashMap(); Iterator keys =
* object.keys(); while (keys.hasNext()) { String key = (String) keys.next();
* map.put(key, fromJson(object.get(key))); } return map; }
*/
public static void main(String[] args) {
getCloudMongoEventScanAndOrder();
}



case CLOUDMONGOEVENTSCANANDORDER:
return getCloudMongoEventScanAndOrder();


https://cloud.mongodb.com/api/public/v1.0/groups/5373a8689194bf134f7a93ad/hosts/4a071190e0434ff7adca2985c5b5437e/measurements?granularity=PT10S&start=2020-05-06T18:36:51.721Z&end=2020-05-06T18:41:12.381Z&m=OPERATIONS_SCAN_AND_ORDER&processId=CoreX-STG-db-eb-s1-01.awsdsi.ghx.com:27027&pretty=true

>>>>>>>>>>>>>>>>>>>>>>>>>>.


CoreX-PRD-io-engine-release
CoreX-PRD-processing-engine-master
CoreX-PRD-data-poller-master
CoreX-PRD-jobs-master
CoreX-PRD-regapi-ws-master
CoreX-PRD-db-eb-s1-02


Infrastructure: CPU
HEAP

event bus opcounter scan

egx-tpm-prd 

explorer->service-> select engines--> click Metrics Explorer

not available for Engines

Insight is going away means, what is the replacement for Querying those metrices, in our python scripts we are using insight URL for querying few of our metrics(hikari not available)

Explorer -> DynamoDB tables ->Control_number_sequence_PRD -> Consumed read capacity units, Consumed Write Capacity units, conditional check failed

Explorer -> select Engine -> Transaction ,DB

>>>>>>>>>>>>>>>>>>>>>>>>

SELVAPRIYA KANNAN

Personal info
Phone:
8248060811
Email:
kspriyaece1995@gmail.com
Address:
60/4 , st.Paul Church, west Street, Bastian Nagar, Muddakkusalai., Madurai, 625016 (IN)

Skills
JUnit and Cobertura
Bamboo,Jmeter
Spring MVC and Boot
Java,Maven building tools
AWS,HTML,CSS,AngularJS


Employment history
Assosiate Software Engineer, SMI. Madurai, Tamil Nadu
Jan. 2018 – Present
Worked in a highly technical and worthy project in the company.It is a project  with high Code Standard having Client at US and coordinating company in Russia.

Communicate with staff or clients to understand specific software requirements.
Provide advice on project costs, design concepts, or design changes.
Have worked in documenting, Knowledge on  jiira workflow  with requirements described by our Client, Coordinate and explained team regarding better understanding of Requirement.
Have led , guided and supervised Juniors.
Provide technical guidance or support for the development or troubleshooting of Application issues
Communicate project information through presentations and have sync up with team.
Have got a chance to work in AWS Services Cloudwatch, Elasticsearch Services,IAM (User, Roles, access policies), S3,EC2,VPC,AutoScaling,Lambda function in python,java ,CloudWatch (triggers, crons and schedules)and building Bamboo Build and Deployment Plans.
Written Junit test Cases and used Cobertura code coverage for development of Code Quality.
Integrated AWS from Java application, Got familiar to Jmeter software and Coding services.
Worked in Maven Building tool which has git repository with Rest API call to Backend.
Have Understanding ON Node , Angular and NPM related modules.Good Knowledge in Mongo and ElasticSearch( somewhat familiar in logstash),Worked with Morphia , SearchClient CRUD operations.
Data base Working Tools:
Robo3t - mongo,
Cerebro - ElasticSearch,
    Mysql Workbench - Mysql.
    Programming IDE:
    Anaconda and Pylint - python,
    Eclipse and sonalint - java,
    Visual Studio Code and Eclipse - AngularJS.
   Building and Deployment Tool:
   Bamboo.
   WorkFlow DashBoard:
   Jiira.
   
Software Trainee, IWare Consultancy Services. Bangalore, Karnataka
Sep. 2016 – Dec. 2018
Gained Experience in working with seniors.
Got familiar to technical term and coordinated with team to understand the flow.
Communicate with staff or clients to understand specific software requirements.
Provide advice on project costs, design concepts, or design changes.
Had Change to work both in AngularJS and Backend java (familar in postman app for Rest API) with Data base Mysql.
Worked in SVN repository, with various technical challenges.
Have got a team Lead and team member keen in technical Improvement of my Carrier.
Have got training for AngularJS with Java and Advance Java.Familiar with Spring boot and Spring MVC framework.
Have made a productive part for the development of the company.
Data base Working Tools:
    Mysql Workbench - Mysql.
Programming IDE:
    Eclipse - java,
    Eclipse - AngularJS.
Education
SACS MAVMM Engineering College, Madurai, TamilNadu
BE, Electronics and Communication Engineering, Apr. 2016

>>>>>>>>>>>>>>>>>>>>>>>>>>...>>

SELVAPRIYA KANNAN

Personal info
Phone:
8248060811
Email:
kspriyaece1995@gmail.com
Address:
60/4 , st.Paul Church, west Street, Bastian Nagar, Muddakkusalai., Madurai, 625016 (IN)

Skills
JUnit and Cobertura
Bamboo,Jmeter
Spring MVC and Boot
Java,Maven building tools
AWS,HTML,CSS,AngularJS


Employment history
Assosiate Software Engineer, SMI. Madurai, Tamil Nadu
Jan. 2018 – Present
Worked in a highly technical and worthy project in the company.It is a project  with high Code Standard having Client at US and coordinating company in Russia.

Communicate with staff or clients to understand specific software requirements.
Provide advice on project costs, design concepts, or design changes.
Have worked in documenting, Knowledge on  jiira workflow  with requirements described by our Client, Coordinate and explained team regarding better understanding of Requirement.
Have led , guided and supervised Juniors.
Provide technical guidance or support for the development or troubleshooting of Application issues
Communicate project information through presentations and have sync up with team.
Have got a chance to work in AWS Services Cloudwatch, Elasticsearch Services,IAM (User, Roles, access policies), S3,EC2,VPC,AutoScaling,Lambda function in python,java ,CloudWatch (triggers, crons and schedules)and building Bamboo Build and Deployment Plans.
Written Junit test Cases and used Cobertura code coverage for development of Code Quality.
Integrated AWS from Java application, Got familiar to Jmeter software and Coding services.
Worked in Maven Building tool which has git repository with Rest API call to Backend.
Have Understanding ON Node , Angular and NPM related modules.Good Knowledge in Mongo and ElasticSearch( somewhat familiar in logstash),Worked with Morphia , SearchClient CRUD operations.
Data base Working Tools:
Robo3t - mongo,
Cerebro - ElasticSearch,
    Mysql Workbench - Mysql.
    Programming IDE:
    Anaconda and Pylint - python,
    Eclipse and sonalint - java,
    Visual Studio Code and Eclipse - AngularJS.
   Building and Deployment Tool:
   Bamboo.
   WorkFlow DashBoard:
   Jiira.
   
Software Trainee, IWare Consultancy Services. Bangalore, Karnataka
Sep. 2016 – Dec. 2018
Gained Experience in working with seniors.
Got familiar to technical term and coordinated with team to understand the flow.
Communicate with staff or clients to understand specific software requirements.
Provide advice on project costs, design concepts, or design changes.
Had Change to work both in AngularJS and Backend java (familar in postman app for Rest API) with Data base Mysql.
Worked in SVN repository, with various technical challenges.
Have got a team Lead and team member keen in technical Improvement of my Carrier.
Have got training for AngularJS with Java and Advance Java.Familiar with Spring boot and Spring MVC framework.
Have made a productive part for the development of the company.
Data base Working Tools:
    Mysql Workbench - Mysql.
Programming IDE:
    Eclipse - java,
    Eclipse - AngularJS.
Education
SACS MAVMM Engineering College, Madurai, TamilNadu
BE, Electronics and Communication Engineering, Apr. 2016

>>>>>>>>>>>>>>>>....

response.html:

<meta http-equiv="Cache-control" content="public">
<link id="favicon" rel="shortcut icon" type="image/x-icon" href="resources/images/favicon.ico">
<div class="">
<script>
document.write('<link rel="stylesheet" type="text/css" href="css/bootstrap.1.52.1.min.css">');
document.write('<link rel="stylesheet" type="text/css" href="css/identity-service.1.52.1.css">');
</script>








<!DOCTYPE html>
<html lang="en">
<head>
    <base href="https://login-stg.awsdsi.ghx.com/">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <meta charset="utf-8">
    <title>GHX Single Sign On - Login</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">    









  <script type="text/javascript">
document.write('<link rel="stylesheet" type="text/css" href="font-awesome/css/font-awesome.1.52.1.min.css">');
document.write('<script type="text/javascript" charset="UTF-8" src="resources/js/lib/jquery/jquery-1.11.0.min.js"><\/script>');
document.write('<script type="text/javascript" charset="UTF-8" src="resources/js/lib/wizard.1.52.1.js"><\/script>');
document.write('<script type="text/javascript" charset="UTF-8" src="resources/materialize/dist/js/materialize.1.52.1.min.js"><\/script>');
document.write('<script type="text/javascript" charset="UTF-8" src="resources/js/lib/bootstrap.1.52.1.min.js"><\/script>');
document.write('<script type="text/javascript" charset="UTF-8" src="resources/js/lib/moment-with-locales.1.52.1.js"><\/script>');
document.write('<script type="text/javascript" charset="UTF-8" src="resources/js/lib/commonUtils.1.52.1.js"><\/script>');
document.write('<script type="text/javascript" charset="UTF-8" src="resources/js/lib/bootstrap-select.js"><\/script>');
document.write('<script type="text/javascript" charset="UTF-8" src="resources/js/lib/jquery.validate.min.js"><\/script>');
document.write('<link rel="stylesheet" type="text/css" href="resources/css/bootstrap-select.min.css">');
document.write('<script type="text/javascript" charset="UTF-8" src="resources/js/lib/jquery.toast.min.js"><\/script>');
document.write('<link rel="stylesheet" type="text/css" href="resources/css/jquery.toast.min.css">');
</script>
    
    <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
    <!--[if lt IE 9]>
    <script src="js/lib/html5.js"></script>
    <![endif]-->

<script type="text/javascript">
        /* $.i18n.init({
            fallbackLng: "en",
            lng: "en",
            resGetPath: "resources/js/locale/__lng__/messages.json"
        }); */
        moment.locale("en");
    // safely set the title of the application
function setPageTitle() {
    document.title = "GHX Single Sign On - Login";
    }
   
// get the info of the current user, if available (null otherwise)
    function getUserInfo() {
    return ;
    }
// get the authorities of the current user, if available (null otherwise)
function getUserAuthorities() {
return ["ROLE_ANONYMOUS"];
}
// is the current user an admin?
// NOTE: this is just for  
function isAdmin() {
var auth = getUserAuthorities();
var containsAdmin = false;
auth.forEach(function (el) {
if (el === "ROLE_ADMIN") {
containsAdmin = true;
}
});
if (auth && containsAdmin) {
return true;
} else {
return false;
}
}
function run() {
if(document.getElementsByClassName('loadingDiv') !== 'undefined' && document.getElementsByClassName('loadingDiv').length > 0) {
var load = document.getElementsByClassName('loadingDiv')[0];
if(load !== 'undefined' && load.style !== 'undefined') {
load.style.display = 'none';
}
}
document.title = 'GHX - Login';
}
function activateMfa() {
var userName = document.getElementById("userName").value;
var otpOne = document.getElementById("mfa_one").value;
var otpTwo = document.getElementById("mfa_two").value;
var redirectUrl = document.getElementById("redirectUrl").value;
$('.login-loader').css('display','inline-block');
if(otpOne == '') {
document.getElementById("codeOneDiv").innerHTML = document.getElementById("codeOneRequired").innerHTML;
document.getElementById("codeOneDiv").style.display='block';
document.getElementById("mfa_one").focus();
$('.login-loader').css('display','none');
return false;
}else if(otpTwo == '') {
document.getElementById("codeTwoDiv").innerHTML = document.getElementById("codeTwoRequired").innerHTML;
document.getElementById("codeTwoDiv").style.display='block';
document.getElementById("mfa_two").focus();
$('.login-loader').css('display','none');
return false;
}else {
$('.login-loader').css('display','inline-block');
$.ajax({
        type: 'POST',
        url: '/rest/user/mfa/activate/'+userName+'/'+otpOne+'/'+otpTwo,
        success: function(data, textStatus, jqXHR){
        redirectDashboard(redirectUrl);
        },
        error: function(jqXHR, textStatus, errorThrown){
        var responseText = jQuery.parseJSON(jqXHR.responseText);
        document.getElementById("codeOneDiv").style.display='block';
        document.getElementById("codeOneDiv").innerHTML = responseText.message;
        document.getElementById("mfa_one").select();
        $('.login-loader').css('display','none');
    }
});
}
}
function redirectDashboard(data){
    window.location.href=data;    
    }
function loginSubmit(){
if(document.getElementById("mfa").value == ''){
document.getElementById("mfaFormDivError").style.display='block';
document.getElementById("user_mfa").focus();
$('.login-loader').css('display','none');
return false;
} else {
$('.login-loader').css('display','inline-block');
    document.getElementById("user_mfa").value=document.getElementById("mfa").value;
    document.getElementById("loginForm").submit();
}
   
    }
var mfaFormVisible = false;
function isMFAUser() {
var userName = document.getElementById('j_username').value;
if(userName == '' || passWord == '') {
clearErrorMsg();
}
if(submitForm()){
var queryParam = "userName="+userName;
$('.login-loader').css('display','inline-block');
    $.ajax({
        type: 'GET',
        url: '/rest/user/mfa/status?'+queryParam,
        success: function(data, textStatus, jqXHR){
        showMFA(data);
       
        },
        error: function(jqXHR, textStatus, errorThrown){
        document.getElementById("loginForm").submit();
        $('.login-loader').css('display','none');
    }
});
}else{
$('.login-loader').css('display','none');
}
}
function showMFA(data){
    var parsed_data = JSON.parse(JSON.stringify(data));
    if(parsed_data.hasOwnProperty('mfaEnabled')){
    if(parsed_data.mfaEnabled === true && (parsed_data.orgMfaStatus!='DISABLED')){
$('.login-loader').css('display','none');
        var loginFormDiv = document.getElementById("loginFormDiv");
        var mfaFormDiv = document.getElementById("mfaFormDiv");
        if(document.getElementById("errMsg")) {
        document.getElementById("errMsg").style.display="none";
        }
        loginFormDiv.style.display = "none";
        mfaFormDiv.style.display = "block";
        mfaFormVisible = true;
       
    }else{
    document.getElementById("loginForm").submit();
    }
    }else{
    document.getElementById("loginForm").submit();
    }
    }

function cancel(){
    document.getElementById("mfa").value = '';
    var loginFormDiv = document.getElementById("loginFormDiv");
    var mfaFormDiv = document.getElementById("mfaFormDiv");
    loginFormDiv.style.display = "block";
    mfaFormDiv.style.display = "none";
    }
function validateMfa() {
if(document.getElementById("mfa").value == ''){
document.getElementById("mfa").focus();
document.getElementById('mfaFormDivError').style.display = 'block';
$('.login-loader').css('display','none');
} else {
var userName = document.getElementById('userName').value;
var mfaAttempt = document.getElementById('mfaAttempt').value;
var whiteLabelId = document.getElementById('whiteLabelId').value;
var redirectUrl = document.getElementById('redirectUrl').value;
if(redirectUrl.indexOf("whiteLabelId")==-1){
        redirectUrl = redirectUrl+"&whiteLabelId="+whiteLabelId
        }
var queryParam = "userName="+userName+"&mfaAttempt="+mfaAttempt+"&appRedirectUrl="+redirectUrl;
var url = '/rest/user/mfa/validate/'+document.getElementById("mfa").value+'?'+queryParam;
$('.login-loader').css('display','inline-block');
    $.ajax({
        type: 'POST',
        url: url,
        success: function(data, textStatus, jqXHR){
        $('.invalid-code').css('display','none');        
        window.location.href=redirectUrl;        
        },
        error: function(jqXHR, textStatus, errorThrown){
        $('.login-loader').css('display','none');
        $('.invalid-code').css('display','block');
        document.getElementById("mfa").select();
        if(mfaAttempt==5){
        if(redirectUrl.indexOf("isMfaFailed")==-1){
        redirectUrl=redirectUrl+"&isMfaFailed=true";
        }
        window.location.href=redirectUrl;
        }
        document.getElementById('mfaAttempt').value = +mfaAttempt + 1;        
    }
});
}
}

document.onkeypress = keyPress;

function keyPress(e){ 
  var x = e || window.event;
  var key = (x.keyCode || x.which);
  if(key == 13 || key == 3){
  $('.login-loader').css('display','inline-block');
  if(window.location.pathname == '/mfa' || window.location.pathname == '/identity-service/mfa'){
  activateMfa();
  }
  else if(window.location.pathname == '/2factor' || window.location.pathname == '/identity-service/2factor'){
  validateMfa();
  }
  else {
  loginSubmit();
  }
  }
}
    </script>
</head>

<body onload="run()">
<!-- Start body -->

<header class="header">
<!-- header -->
<!-- Navigation -->
<nav class="navbar navbar-default header-exchange" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<a id="headerGHX" class="navbar-brand">GHX</a>
</div>
<h5 id="headerAppName" class="header-name"></h5>
</div>
<!-- /.container-fluid -->
</nav>
</header><div class="loadingDiv">
<div class="row"></div>
<span>Loading......</span>
</div>
<div class="app-loading" id="loadingPanel">
<div class="app-loader"></div>
</div>
<div class="containerFixed">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12 col-md-12 col-sm-12">
<div class="login-box">
<div class="login-box-alert">
<div class="login-box-body" id="mfaFormDiv" style="display:none">
<div class="form-group" style="padding-top: 20px">
<h4 class="form-signin-heading-global text-center"><b>Multi-Factor Authentication</b></h4>
<h5 class="form-signin-heading text-center"> Enter your MFA code to Log in.</h5>
<input type="number" class="form-control login-form-control"
autofocus="autofocus" placeholder="Enter Your MFA Code"
onclick="clearErrorMsg()" autocorrect="off" autocapitalize="off"
autocomplete="off" spellcheck="false" maxlength="6"
value="" tabindex="1"
id="mfa" name="mfa"
onkeyup="accessSubmit(this.value,'mfaFormDivError')"> <span
id="mfaFormDivError" class="error hideElement">login.validation.mfacoderequired</span>
</div>
<div class="form-group clearfix">
<button id="mfaSubmit" tabindex="4" class="btn btn-primary btn-login col-lg-4 col-md-4 col-sm-4 col-xs-4" type="button" onclick="loginSubmit()">Submit</button>
<img src="images/login-loader.gif" class="login-loader" />
</div>
<div class="form-group clearfix" style="padding-bottom: 20px">
<span class="login-text">
If you are unable to login with your device, please contact your local user admin to reset the device or GHX support 
</span>
</div>
</div>
<div class="login-box-body" id="loginFormDiv">  <form  onsubmit="return submitForm()" style="margin: 0px"
action="/login" method="POST"
class="form-horizontal loginFormCls " 
name="loginForm" role="form" id="loginForm" autocomplete="off">
<div class="rootDiv">





<h4 class="form-signin-heading-global text-center">
<b>GHX Login</b>
</h4>
<h5 class="form-signin-heading text-center"> Enter your GHX credentials to log in.</h5>
<div
class="form-group">
<input type="text" class="form-control login-form-control"
autofocus="autofocus" placeholder="User Name/Email Address"
onclick="clearErrorMsg()" autocorrect="off" autocapitalize="off"
autocomplete="off" spellcheck="false" maxlength="100"
value="" tabindex="1"
id="j_username" name="j_username" onkeypress="accessSubmit(this.value, 'usernameDiv')"  
onkeyup="accessSubmit(this.value,'usernameDiv')"> <span
id="usernameDiv" class="error hideElement">User Name/Email Address is required</span>
</div>
<div
class="form-group">
<input type="password" class="form-control login-form-control"
placeholder="Password" onclick="clearErrorMsg()"
autocorrect="off" autocapitalize="off" autocomplete="off"
spellcheck="false" maxlength="100" id="j_password" tabindex="2"
name="j_password" onkeypress="accessSubmit(this.value, 'passwordDiv')" 
onkeyup="accessSubmit(this.value,'passwordDiv')"> <span
id="passwordDiv" class="error hideElement">Password is required</span>
<a class="pull-right underlined-link underlined-link-right"  tabindex="3" href="/forgotpassword">Forgot Password?</a>
</div>
<div class="form-group clearfix">
<button id="btnLogin" tabindex="4" class="btn btn-primary btn-login col-lg-6 col-md-6 col-sm-6 col-xs-6" type="submit" >Login</button>
<img src="images/login-loader.gif" class="login-loader" />
</div>
<div class="form-group new-supplier-reg-link"  id="userLang">
<span class="pull-left login-link" >
<a class="underlined-link" tabindex="5" href='https://registersupplier-stg.awsdsi.ghx.com/registration/' target="_blank"><em>New Supplier Registration?</em></a>
</span>
<div class="clearfix"></div>
<span class="pull-left login-text">
Gain access to Vendormate Credentialing, Compliance and Contracting requests.
</span>
</div>
</div>
<input type="hidden" name="user_mfa" id="user_mfa" value="123" />
<input type="hidden" name="whiteLabelId" id="whiteLabelId" value=""/>
<input type="hidden" name="whiteLabelError" id="whiteLabelError" value=""/>
<input type="hidden" name="_csrf" value="ecef6817-eebe-4de0-a0a2-9183dc38a05c" />
<input type="hidden" name="languagesCode" id="languagesCode" value="&#034;bg, cs, da, de, el, es, et, fi, fr, ga, hr, hu, it, lt, lv, mt, nl, pl, pt, ro, sk, sl, sv&#034;"/>
<input type="hidden" name="contextPath" id="contextPath" value="https://login-stg.awsdsi.ghx.com/identity-service/" />
</form>
</div> </div></div></div></div></div></div>
</div>




<div id="push"></div>
<!-- end #wrap -->
<footer id="footer" class="app-footer">
<div class="container-fluid">




<div class="footer-exchange footer-version footer-version-color text-center">
<div class="text-center">
<span class="footer-right-space">For the Privacy Terms,</span><span> &#169; 2020</span> <span class="footer-right-space">Global Healthcare Exchange, LLC</span>. <span>All Rights Reserved</span> <span class="footerLink">|</span> <a
target="_blank" href="https://www.ghx.com/terms-of-use/" id="termsOfUse">Terms of use</a> <span class="footerLink" id="termsOfUseSeparator">|</span>
<a target="_blank" href="https://www.ghx.com/privacy-policy/" id="privacyPolicy">Privacy Policy</a> <span class="footerLink" id="privacyPolicySeparator">|</span>
<a target="_blank" id="usCustomerCare" style="visibility: hidden;" href="https://www.ghx.com/customer-care/">Customer Care</a>
<a target="_blank" id="euCustomerCare" style="visibility: hidden;">Customer Care</a>
</div>
</div>
</div>
</footer>
</body>
</html>
<script type="text/javascript">
var userName, passWord;
var userLang = navigator.language || navigator.userLanguage;
var langs = document.getElementById("languagesCode").value;
var languages = langs.substring(1, langs.length-1).split(", ");
if(document.getElementById("j_username")) {
document.getElementById("j_username").focus();
}
if (languages.indexOf(userLang) > -1 && document.getElementById('userLang')) {
document.getElementById('userLang').style.display = 'none';
}
if (languages.indexOf(getUrlParam("lang","en")) > -1 && document.getElementById('userLang')) {
document.getElementById('userLang').style.display = 'none';
}
function clearErrorMsg() {
if (document.getElementById('errMsg') != null) {
document.getElementById('errMsg').style.display = 'none';
}
}
function accessSubmit(fieldValue, errorDiv) {
if (fieldValue != '' && document.getElementById(errorDiv)) {
document.getElementById(errorDiv).style.display = 'none';
}
}
function submitForm() {
userName = document.getElementById('j_username').value;
passWord = document.getElementById('j_password').value;
document.getElementById('usernameDiv').style.display = 'none';
document.getElementById('passwordDiv').style.display = 'none';

if(userName == '' || passWord == '') {
clearErrorMsg();
}

if (userName == '') {
document.getElementById('usernameDiv').style.display = 'block';
} else if (passWord == '') {
document.getElementById('passwordDiv').style.display = 'block';
} else {
$('.login-loader').css('display','inline-block');
return true;
}
return false;
}
function forgotPass () {
var whiteLabelId = document.getElementById('whiteLabelId').value;
var contextPath = document.getElementById('contextPath').value;
window.location.href = contextPath + 'forgotpassword?whiteLabelId=' + whiteLabelId;
}

function getUrlVars() {
var vars = {};
var parts = window.location.href.replace(/[?&]+([^=&]+)=([^&]*)/gi,
function(m, key, value) {
vars[key] = value;
});
return vars;
}

function getUrlParam(parameter, defaultvalue) {
var urlparameter = defaultvalue;
if (window.location.href.indexOf(parameter) > -1) {
urlparameter = getUrlVars()[parameter];
}
return urlparameter;
}
</script>
<script>
var whiteLabelId = document.getElementById('whiteLabelId').value;
var footerHover, footerText, headerText;
if (whiteLabelId != 'null'  && whiteLabelId != '') {
jQuery('document').ready(function(){
loginLoading = document.getElementsByClassName('sso-loader')[0];
loginLoading.style.display = 'block';
jQuery.ajax( "rest/wl?whiteLabelId="+jQuery('#whiteLabelId').val() )
.done(function(brandingDetails) {
loginLoading.style.display = 'none';
jQuery('.app-container').show();
preferenceConfig = JSON.parse(brandingDetails.preferenceConfig);
jQuery('.ghx-login-form .wl-adapter-login-footer').css({
"background-color": preferenceConfig.footerBackground,
"color": preferenceConfig.footerText
});
jQuery('.ghx-login-form .wl-adapter-login-footer span').css({
"background-color": preferenceConfig.footerBackground,
"color": preferenceConfig.footerText
});
jQuery('#branding-about-content').html(preferenceConfig.aboutText);
jQuery('#branding-about-content').css({"color": preferenceConfig.headerText});
jQuery('.ghx-login-form .wl-adapter-login-footer a').css({"color": preferenceConfig.footerText});
footerHover = preferenceConfig.footerHoverText;
footerText = preferenceConfig.footerText;
jQuery('#branding-logo').attr('src', brandingDetails.headerLogo.contentType + brandingDetails.headerLogo.imageBytes);
jQuery('#brandingLogoMLogin').attr('src', brandingDetails.headerLogo.contentType + brandingDetails.headerLogo.imageBytes);
var backgroundImage = brandingDetails.headerBackgroundImage.contentType + brandingDetails.headerBackgroundImage.imageBytes;
jQuery("#favicon").attr("href",brandingDetails.favicon.contentType + brandingDetails.favicon.imageBytes);
jQuery('.ghx-about-content').css(
{"background": "linear-gradient( "+hexToRgbA(preferenceConfig.headerOverlayColor)+", "+hexToRgbA(preferenceConfig.headerOverlayColor)+"), url( '"+ backgroundImage +"' )",
"background-size":"cover"
}
);
})
.fail(function(error) {
var contextPath = document.getElementById('contextPath').value;
window.location.href = contextPath + 'login';
});
});
}
jQuery('.ghx-login-form .wl-adapter-login-footer a').mouseover(function(){
$(this).css({"color": footerHover});
}).mouseout(function() {
    $(this).css("color",footerText);
});
function hexToRgbA(hex){
var c;
if (/^#([A-Fa-f0-9]{3}){1,2}$/.test(hex)) {
c= hex.substring(1).split('');
if (c.length== 3) {
c= [c[0], c[0], c[1], c[1], c[2], c[2]];
}
c= '0x'+c.join('');
return 'rgba('+[(c>>16)&255, (c>>8)&255, c&255].join(',')+', .8)';
}
throw new Error('Bad Hex');
}

var userLang = navigator.language || navigator.userLanguage;

if (languages.indexOf(userLang) > -1 && document.getElementById('userLang')) {
document.getElementById('userLang').style.display = 'none';
}
if (languages.indexOf(userLang) > -1) {
if(userLang.indexOf('de') > -1) {
document.getElementById('euCustomerCare').href = "https://www.ghx.com/europe/de/customer-care/";
document.getElementById('termsOfUse').style.display = "none";
document.getElementById('privacyPolicy').style.display = "none";
document.getElementById('termsOfUseSeparator').style.display = "none";
document.getElementById('privacyPolicySeparator').style.display = "none";
} else {
document.getElementById('euCustomerCare').href = "https://www.ghx.com/europe/en/customer-care/";
}
if(document.getElementById('euCustomerCare')) {
document.getElementById('euCustomerCare').style.visibility = "visible";
}
if(document.getElementById('usCustomerCare')) {
document.getElementById('usCustomerCare').style.display = "none";
}
} else {
if(document.getElementById('euCustomerCare')) {
document.getElementById('euCustomerCare').style.display = "none";
}
if(document.getElementById('usCustomerCare')) {
document.getElementById('usCustomerCare').style.visibility = "visible";
}
}
</script>

>>>>>>>>>>

#!/usr/bin/python
"""
collects cpu and db connection metric for TPM details and push to ES
"""
import logging
import time
import json
import re
from datetime import datetime, timedelta
#import boto3
import requests
from requests import get
from requests.utils import quote
from elasticsearch import Elasticsearch, helpers

def load_config(configobj, cfile):
    """load configuration details"""
    f = open(cfile, 'r')
    for line in f:
        line = line.strip()
        (param, value) = re.split(':', line, maxsplit=1)
        configobj[param] = value
    f.close()
    return configobj

# end load_config

def set_subdomain(metaobj):
    """set sub domain details"""
    if metaobj['accountId'] == "050190852521":
        subd = 'awsdsi.ghx.com'
    else:
        subd = 'awsprd.ghx.com'
    return subd

dateTag = datetime.now().strftime("%Y-%b-%d")
LOG_FILENAME = '/var/log/cloudmetric/cloudmongometriccollection.log_%s.log'
logging.basicConfig(filename=LOG_FILENAME % dateTag, level=logging.INFO)
logging.info('Started')

configuration = {}
load_config(configuration, '/opt/conf/cf-params.txt')

meta = json.loads(get('http://169.254.169.254/latest/dynamic/instance-identity/document/').content)
instance_id = meta['instanceId']
hostname = meta['privateIp']

subdomain = set_subdomain(meta)

es = Elasticsearch(['https://' + meta['region'] + '-testframework-es.' + subdomain ] , verify_certs=False)

#cw = boto3.resource('ec2', region_name=meta['region'])
total_exec_time = 0
env = configuration['GHXEnvironment'].lower()

newrelic_api_insight_url = configuration['NewrelicApiInsightUrl']
newrelic_query_key = configuration['NewrelicQueryKey']
while True:
    try:
        cloudmongoscanandorders = []
        cloudmongooscanandOrderRs12s1 = {}
        cloudmongooscanandOrderRs12s2 = {}

        scan_and_order_indexname = env + '-newrelic-' + 'scan-and-order-utilization'
        opcounter_indexname = env + '-newrelic-' + 'opcounter-query-utilization'
        exec_starttime = datetime.utcnow()
        now = datetime.utcnow()
        pasttime = (now - timedelta(minutes=2)).strftime("%Y-%m-%dT%H:%M:%SZ")
        currenttime = (now - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:%SZ")
        
        entity_name = quote("%event-bus-" + 'stg' + "-sharded-cluster%")
        print(currenttime)
        print(pasttime)
        nrql_scan_and_order_rs12_s1_es_url = newrelic_api_insight_url + "query?nrql=" \
        "SELECT average(operation.scanAndOrderPerSecond) " \
        "FROM MongodSample " \
        "where label.mongoCluster IN ('" + entity_name + "','rs12-s1') " \
        " SINCE '" + pasttime + "' UNTIL '" + currenttime + "'"
        nrql_scan_and_order_rs12_s2_es_url = newrelic_api_insight_url + "query?nrql=" \
        "SELECT average(operation.scanAndOrderPerSecond) " \
        "FROM MongodSample " \
        "where label.mongoCluster IN ('" + entity_name + "','rs12-s2') " \
        " SINCE '" + pasttime + "' UNTIL '" + currenttime + "'"

        print(nrql_scan_and_order_rs12_s1_es_url)
        print(nrql_scan_and_order_rs12_s2_es_url)
        nrql_scan_and_order_rs12_s1_es_results = requests.get(nrql_scan_and_order_rs12_s1_es_url,
                                   headers={"X-Query-Key" : newrelic_query_key,
                                            "Accept": "application/json"})
        print(nrql_scan_and_order_rs12_s1_es_results)
        nrql_scan_and_order_rs12_s1_es_results_json = nrql_scan_and_order_rs12_s1_es_results.json()
        print(nrql_scan_and_order_rs12_s1_es_results_json)

        nrql_scan_and_order_rs12_s2_es_results = requests.get(nrql_scan_and_order_rs12_s2_es_url,
                headers={"X-Query-Key" : newrelic_query_key,
                                            "Accept": "application/json"})
        print(nrql_scan_and_order_rs12_s2_es_results)
        nrql_scan_and_order_rs12_s2_es_results_json = nrql_scan_and_order_rs12_s2_es_results.json()
        print(nrql_scan_and_order_rs12_s2_es_results_json)

        print(nrql_scan_and_order_rs12_s2_es_results_json['results'][0]['average'])
        cloudmongooscanandOrderRs12s1 = {
            'ipwithhostname': 'CoreX-'+env.upper()+'-db-eb-s1-01.awsdsi.ghx.com-rs12-s1',
            'clusterName': 'event-bus-' + env.upper() \
                            + '-sharded-cluster',
                            'replicaset': 'rs12-s1',
                            'measurement_type': 'OPERATIONS_SCAN_AND_ORDER',
                            'value': nrql_scan_and_order_rs12_s1_es_results_json['results'][0]['average'],
                            '@timestamp': currenttime,
                            }
        logging.info(cloudmongooscanandOrderRs12s1)
        cloudmongooscanandOrderRs12s2 = {
            'ipwithhostname': 'CoreX-'+env.upper()+'-db-eb-s1-01.awsdsi.ghx.com-rs12-s2',
            'clusterName': 'event-bus-' + env.upper() \
                            + '-sharded-cluster',
                            'replicaset': 'rs12-s2',
                            'measurement_type': 'OPERATIONS_SCAN_AND_ORDER',
                            'value': nrql_scan_and_order_rs12_s2_es_results_json['results'][0]['average'],
                            '@timestamp': currenttime,
                            }
        logging.info(cloudmongooscanandOrderRs12s2)

        indexname = env + '-cloudmongo-scanandorder'

        Rs12s1data_dict = {'_op_type': 'index',
                           '_index': indexname,
                           '_source': cloudmongooscanandOrderRs12s1}
        logging.info(Rs12s1data_dict)
        Rs12s2data_dict = {'_op_type': 'index',
                           '_index': indexname,
                           '_source': cloudmongooscanandOrderRs12s2}
        logging.info(Rs12s2data_dict)

        cloudmongoscanandorders.append(Rs12s1data_dict)
        cloudmongoscanandorders.append(Rs12s2data_dict)
        print(cloudmongoscanandorders)
        try:
            print("before es bulk indexing")
            helpers.bulk(client=es, actions=cloudmongoscanandorders)
            print("after es bulk indexing")
        except Exception as ex:
            logging.exception(ex)
            es.indices.refresh()
            cloudmongoscanandorders = []
            exec_endtime = datetime.utcnow()
            total_exec_time = abs(exec_endtime-exec_starttime).seconds
   
cloudmongoopcounterquery = []
        cloudmongoopcounterqueryRs12s1 = {}
        cloudmongoopcounterqueryRs12s2 = {}

        scan_and_order_indexname = env + '-newrelic-' + 'scan-and-order-utilization'
        opcounter_indexname = env + '-newrelic-' + 'opcounter-query-utilization'
        exec_starttime = datetime.utcnow()
        now = datetime.utcnow()
        pasttime = (now - timedelta(minutes=2)).strftime("%Y-%m-%dT%H:%M:00") + "Z"
        currenttime = (now - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:00") + "Z"
        entity_name = quote("%event-bus-" + 'stg' + "-sharded-cluster%")
        entity_name_not_like = quote("%repl%")
        #print(currenttime)
        #print(pasttime)
        #SELECT average(opcounters.queryPerSecond) AS 'query' FROM MongodSample WHERE label.mongoCluster = 'rs12-s2' FACET displayName TIMESERIES
        nrql_opcounter_query_rs12_s1_es_url = newrelic_api_insight_url + "query?nrql=" \
            "SELECT average(opcounters.queryPerSecond) AS 'query' " \
                "FROM MongodSample WHERE label.mongoCluster = 'rs12-s1' " \
                "SINCE '" + pasttime + "' UNTIL '" + currenttime + "' FACET displayName TIMESERIES"
        nrql_opcounter_query_rs12_s2_es_url = newrelic_api_insight_url + "query?nrql=" \
                "SELECT average(opcounters.queryPerSecond) AS 'query' " \
                "FROM MongodSample WHERE label.mongoCluster = 'rs12-s2'" \
                " SINCE '" + pasttime + "' UNTIL '" + currenttime + "' FACET displayName TIMESERIES"
        #nrql_scan_and_order_es_url = "https://insights-api.newrelic.com/v1/accounts/1550954/query?nrql=SELECT operation.scanAndOrderPerSecond FROM MongodSample WHERE label.mongoEnv = 'GHX-DEV' AND label.mongoCluster IN('event-bus-stg-sharded-cluster','rs11-s2')"
        print(nrql_opcounter_query_rs12_s1_es_url)
        print(nrql_opcounter_query_rs12_s2_es_url)

        nrql_opcounter_query_rs12_s1_es_results = requests.get(nrql_opcounter_query_rs12_s1_es_url,
        headers={"X-Query-Key" : newrelic_query_key,
                                            "Accept": "application/json"})
        #print(nrql_opcounter_query_rs12_s1_es_results)
        nrql_opcounter_query_rs12_s1_es_results_json = nrql_opcounter_query_rs12_s1_es_results.json()
        #print(nrql_opcounter_query_rs12_s1_es_results)

        nrql_opcounter_query_rs12_s2_es_results = requests.get(nrql_opcounter_query_rs12_s2_es_url,
        headers={"X-Query-Key" : newrelic_query_key,
                                            "Accept": "application/json"})
        #print(nrql_opcounter_query_rs12_s2_es_results)
        nrql_opcounter_query_rs12_s2_es_results_json = nrql_opcounter_query_rs12_s2_es_results.json()
        #print(nrql_opcounter_query_rs12_s2_es_results_json)

        #print(nrql_opcounter_query_rs12_s1_es_results_json['facets'])
        #print(nrql_opcounter_query_rs12_s2_es_results_json['facets'])


        rs12_s1_facets = nrql_opcounter_query_rs12_s1_es_results_json['facets']
        rs12_s2_facets = nrql_opcounter_query_rs12_s2_es_results_json['facets']

        #print(rs12_s1)
        #print(rs12_s2)
        indexname = env + '-cloudmongo-opcounter-query'

        print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
        for rs12_s1_facet in rs12_s1_facets:
            name = rs12_s1_facet['name']
            name = name.replace(':27027', '')
            print(name)
            print(rs12_s1_facet['total']['results'][0]['average'])
            cloudmongoopcounterqueryRs12s1 ={
                "replicaset" : "rs12-s1",
                "clusterName" : "event-bus-stg-sharded-cluster",
                "@timestamp" : currenttime,
                "value" : rs12_s1_facet['total']['results'][0]['average'],
                "measurement_type" : "OPCOUNTER_QUERY",
                "ipwithhostname" : name
            }
            print(cloudmongoopcounterqueryRs12s1)
            Rs12s1data_dict = {'_op_type': 'index',
                           '_index': indexname,
                           '_source': cloudmongoopcounterqueryRs12s1}
            logging.info(Rs12s1data_dict)

            cloudmongoopcounterquery.append(Rs12s1data_dict)
            #print("###################S1")
            #print(cloudmongoopcounterquery)
            #print("###################S1")
        print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")

        print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
        for rs12_s2_facet in rs12_s2_facets:
            name = rs12_s2_facet['name']
            name = name.replace(':27027', '')
            print(name)
            print(rs12_s2_facet['total']['results'][0]['average'])
            cloudmongoopcounterqueryRs12s2 ={
                "replicaset" : "rs12-s2",
                "clusterName" : "event-bus-stg-sharded-cluster",
                "@timestamp" : currenttime,
                "value" : rs12_s2_facet['total']['results'][0]['average'],
                "measurement_type" : "OPCOUNTER_QUERY",
                "ipwithhostname" : name
            }
            Rs12s2data_dict = {'_op_type': 'index',
                           '_index': indexname,
                           '_source': cloudmongoopcounterqueryRs12s2}
            logging.info(Rs12s2data_dict)
            cloudmongoopcounterquery.append(Rs12s2data_dict)

            print(cloudmongoopcounterqueryRs12s2)
        print(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>")
        #print("###################S2")
        #print(cloudmongoopcounterquery)
        #print("###################S2")
        try:
            print("before es bulk indexing")
            #print(cloudmongoopcounterquery)
            helpers.bulk(client=es, actions=cloudmongoopcounterquery)
            print("after es bulk indexing")
        except Exception as ex:
            logging.exception(ex)
            es.indices.refresh()
            cloudmongoopcounterquery = []
            exec_endtime = datetime.utcnow()
            total_exec_time = abs(exec_endtime-exec_starttime).seconds
    except Exception as ex:
        logging.exception("message")
    finally:
        time.sleep(59)
logging.info('End')

>>>>>>>>>>>>>>>>>>>>>>>>>>

#!/usr/bin/python
"""
collects cpu and db connection metric for TPM details and push to ES
"""
import logging
import time
import json
import re
from datetime import datetime, timedelta
import boto3
import requests
from requests import get
from requests.utils import quote
from elasticsearch import Elasticsearch, helpers

def load_config(configobj, cfile):
    """load configuration details"""
    f = open(cfile, 'r')
    for line in f:
        line = line.strip()
        (param, value) = re.split(':', line, maxsplit=1)
        configobj[param] = value
    f.close()
    return configobj

# end load_config

def set_subdomain(metaobj):
    """set sub domain details"""
    if metaobj['accountId'] == "050190852521":
        subd = 'awsdsi.ghx.com'
    else:
        subd = 'awsprd.ghx.com'
    return subd

dateTag = datetime.now().strftime("%Y-%b-%d")
LOG_FILENAME = '/var/log/cloudmetric/cloudmongometriccollection.log_%s.log'
logging.basicConfig(filename=LOG_FILENAME % dateTag, level=logging.INFO)
logging.info('Started')

configuration = {}
load_config(configuration, '/opt/conf/cf-params.txt')

meta = json.loads(get('http://169.254.169.254/latest/dynamic/instance-identity/document/').content)
instance_id = meta['instanceId']
hostname = meta['privateIp']

subdomain = set_subdomain(meta)

es = Elasticsearch(['https://' + meta['region'] + '-testframework-es.' + subdomain ] , verify_certs=False)

cw = boto3.resource('ec2', region_name=meta['region'])
total_exec_time = 0
env = configuration['GHXEnvironment'].lower()

newrelic_api_insight_url = configuration['NewrelicApiInsightUrl']
newrelic_query_key = configuration['NewrelicQueryKey']
while True:
    try:
        cloudmongoscanandorders = []
        cloudmongooscanandOrderRs12s1 = {}
        cloudmongooscanandOrderRs12s2 = {}

        scan_and_order_indexname = env + '-newrelic-' + 'scan-and-order-utilization'
        opcounter_indexname = env + '-newrelic-' + 'opcounter-query-utilization'
        exec_starttime = datetime.utcnow()
        now = datetime.utcnow()
        pasttime = (now - timedelta(minutes=2)).strftime("%Y-%m-%dT%H:%M:%SZ")
        currenttime = (now - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:%SZ")
        
        entity_name = quote("%event-bus-" + 'stg' + "-sharded-cluster%")
        entity_name_not_like = quote("%repl%")
        print(currenttime)
        print(pasttime)
        nrql_scan_and_order_rs12_s1_es_url = newrelic_api_insight_url + "query?nrql=" \
        "SELECT average(operation.scanAndOrderPerSecond) " \
        "FROM MongodSample " \
        "where label.mongoCluster IN ('" + entity_name + "','rs12-s1') " \
        " SINCE '" + pasttime + "' UNTIL '" + currenttime + "'"
        nrql_scan_and_order_rs12_s2_es_url = newrelic_api_insight_url + "query?nrql=" \
        "SELECT average(operation.scanAndOrderPerSecond) " \
        "FROM MongodSample " \
        "where label.mongoCluster IN ('" + entity_name + "','rs12-s2') " \
        " SINCE '" + pasttime + "' UNTIL '" + currenttime + "'"

        print(nrql_scan_and_order_rs12_s1_es_url)
        print(nrql_scan_and_order_rs12_s2_es_url)
        nrql_scan_and_order_rs12_s1_es_results = requests.get(nrql_scan_and_order_rs12_s1_es_url,
                                   headers={"X-Query-Key" : newrelic_query_key,
                                            "Accept": "application/json"})
        print(nrql_scan_and_order_rs12_s1_es_results)
        nrql_scan_and_order_rs12_s1_es_results_json = nrql_scan_and_order_rs12_s1_es_results.json()
        print(nrql_scan_and_order_rs12_s1_es_results_json)

        nrql_scan_and_order_rs12_s2_es_results = requests.get(nrql_scan_and_order_rs12_s2_es_url,
                headers={"X-Query-Key" : newrelic_query_key,
                                            "Accept": "application/json"})
        print(nrql_scan_and_order_rs12_s2_es_results)
        nrql_scan_and_order_rs12_s2_es_results_json = nrql_scan_and_order_rs12_s2_es_results.json()
        print(nrql_scan_and_order_rs12_s2_es_results_json)

        print(nrql_scan_and_order_rs12_s2_es_results_json['results'][0]['average'])
        cloudmongooscanandOrderRs12s1 = {
            'ipwithhostname': 'CoreX-'+env.upper()+'-db-eb-s1-01.awsdsi.ghx.com-rs12-s1',
            'clusterName': 'event-bus-' + env.upper() \
                            + '-sharded-cluster',
                            'replicaset': 'rs12-s1',
                            'measurement_type': 'OPERATIONS_SCAN_AND_ORDER',
                            'value': nrql_scan_and_order_rs12_s1_es_results_json['results'][0]['average'],
                            '@timestamp': currenttime,
                            }
        logging.info(cloudmongooscanandOrderRs12s1)
        cloudmongooscanandOrderRs12s2 = {
            'ipwithhostname': 'CoreX-'+env.upper()+'-db-eb-s1-01.awsdsi.ghx.com-rs12-s2',
            'clusterName': 'event-bus-' + env.upper() \
                            + '-sharded-cluster',
                            'replicaset': 'rs12-s2',
                            'measurement_type': 'OPERATIONS_SCAN_AND_ORDER',
                            'value': nrql_scan_and_order_rs12_s2_es_results_json['results'][0]['average'],
                            '@timestamp': currenttime,
                            }
        logging.info(cloudmongooscanandOrderRs12s2)

        indexname = env + '-cloudmongo-scanandorder'

        Rs12s1data_dict = {'_op_type': 'index',
                           '_index': indexname,
                           '_source': cloudmongooscanandOrderRs12s1}
        logging.info(Rs12s1data_dict)
        Rs12s2data_dict = {'_op_type': 'index',
                           '_index': indexname,
                           '_source': cloudmongooscanandOrderRs12s2}
        logging.info(Rs12s2data_dict)

        cloudmongoscanandorders.append(Rs12s1data_dict)
        cloudmongoscanandorders.append(Rs12s2data_dict)
        print(cloudmongoscanandorders)
        try:
            print("before es bulk indexing")
            helpers.bulk(client=es, actions=cloudmongoscanandorders)
            print("after es bulk indexing")
        except Exception as ex:
            logging.exception(ex)
            es.indices.refresh()
            cloudmongoscanandorders = []
            exec_endtime = datetime.utcnow()
            total_exec_time = abs(exec_endtime-exec_starttime).seconds
    except Exception as ex:
        logging.exception("message")
    finally:
        time.sleep(59)
logging.info('End')

>>>>>>>>>>>>>>>>>>>>>>>>>

#!/usr/bin/python
"""
collects cpu and db connection metric for TPM details and push to ES
"""
import logging
import time
import json
import re
from datetime import datetime, timedelta
import boto3
import requests
from requests import get
from requests.utils import quote
from elasticsearch import Elasticsearch, helpers

def load_config(configobj, cfile):
    """load configuration details"""
    f = open(cfile, 'r')
    for line in f:
        line = line.strip()
        (param, value) = re.split(':', line, maxsplit=1)
        configobj[param] = value
    f.close()
    return configobj

# end load_config

def set_subdomain(metaobj):
    """set sub domain details"""
    if metaobj['accountId'] == "050190852521":
        subd = 'awsdsi.ghx.com'
    else:
        subd = 'awsprd.ghx.com'
    return subd

dateTag = datetime.now().strftime("%Y-%b-%d")
LOG_FILENAME = '/var/log/cloudmetric/cloudmongometriccollection.log_%s.log'
logging.basicConfig(filename=LOG_FILENAME % dateTag, level=logging.INFO)
logging.info('Started')

configuration = {}
load_config(configuration, '/opt/conf/cf-params.txt')

meta = json.loads(get('http://169.254.169.254/latest/dynamic/instance-identity/document/').content)
instance_id = meta['instanceId']
hostname = meta['privateIp']

subdomain = set_subdomain(meta)

es = Elasticsearch(['https://' + meta['region'] + '-testframework-es.' + subdomain ] , verify_certs=False)

cw = boto3.resource('ec2', region_name=meta['region'])
total_exec_time = 0
env = configuration['GHXEnvironment'].lower()

newrelic_api_insight_url = configuration['NewrelicApiInsightUrl']
newrelic_query_key = configuration['NewrelicQueryKey']
while True:
    try:
        cloudmongoscanandorders = []
        cloudmongooscanandOrderRs12s1 = {}
        cloudmongooscanandOrderRs12s2 = {}

        scan_and_order_indexname = env + '-newrelic-' + 'scan-and-order-utilization'
        opcounter_indexname = env + '-newrelic-' + 'opcounter-query-utilization'
        exec_starttime = datetime.utcnow()
        now = datetime.utcnow()
        pasttime = (now - timedelta(minutes=2)).strftime("%Y-%m-%dT%H:%M:%SZ")
        currenttime = (now - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:%SZ")
        
        entity_name = quote("%event-bus-" + 'stg' + "-sharded-cluster%")
        entity_name_not_like = quote("%repl%")
        print(currenttime)
        print(pasttime)
        nrql_scan_and_order_rs12_s1_es_url = newrelic_api_insight_url + "query?nrql=" \
        "SELECT average(operation.scanAndOrderPerSecond) " \
        "FROM MongodSample " \
        "where label.mongoCluster IN ('" + entity_name + "','rs12-s1') " \
        " SINCE '" + pasttime + "' UNTIL '" + currenttime + "'"
        nrql_scan_and_order_rs12_s2_es_url = newrelic_api_insight_url + "query?nrql=" \
        "SELECT average(operation.scanAndOrderPerSecond) " \
        "FROM MongodSample " \
        "where label.mongoCluster IN ('" + entity_name + "','rs12-s2') " \
        " SINCE '" + pasttime + "' UNTIL '" + currenttime + "'"

        print(nrql_scan_and_order_rs12_s1_es_url)
        print(nrql_scan_and_order_rs12_s2_es_url)
        nrql_scan_and_order_rs12_s1_es_results = requests.get(nrql_scan_and_order_rs12_s1_es_url,
                                   headers={"X-Query-Key" : newrelic_query_key,
                                            "Accept": "application/json"})
        print(nrql_scan_and_order_rs12_s1_es_results)
        nrql_scan_and_order_rs12_s1_es_results_json = nrql_scan_and_order_rs12_s1_es_results.json()
        print(nrql_scan_and_order_rs12_s1_es_results_json)

        nrql_scan_and_order_rs12_s2_es_results = requests.get(nrql_scan_and_order_rs12_s2_es_url,
                headers={"X-Query-Key" : newrelic_query_key,
                                            "Accept": "application/json"})
        print(nrql_scan_and_order_rs12_s2_es_results)
        nrql_scan_and_order_rs12_s2_es_results_json = nrql_scan_and_order_rs12_s2_es_results.json()
        print(nrql_scan_and_order_rs12_s2_es_results_json)

        print(nrql_scan_and_order_rs12_s2_es_results_json['results'][0]['average'])
        cloudmongooscanandOrderRs12s1 = {
            'ipwithhostname': 'CoreX-'+env.upper()+'-db-eb-s1-01.awsdsi.ghx.com-rs12-s1',
            'clusterName': 'event-bus-' + env.upper() \
                            + '-sharded-cluster',
                            'replicaset': 'rs12-s1',
                            'measurement_type': 'OPERATIONS_SCAN_AND_ORDER',
                            'value': nrql_scan_and_order_rs12_s1_es_results_json['results'][0]['average'],
                            '@timestamp': currenttime,
                            }
        logging.info(cloudmongooscanandOrderRs12s1)
        cloudmongooscanandOrderRs12s2 = {
            'ipwithhostname': 'CoreX-'+env.upper()+'-db-eb-s1-01.awsdsi.ghx.com-rs12-s2',
            'clusterName': 'event-bus-' + env.upper() \
                            + '-sharded-cluster',
                            'replicaset': 'rs12-s2',
                            'measurement_type': 'OPERATIONS_SCAN_AND_ORDER',
                            'value': nrql_scan_and_order_rs12_s2_es_results_json['results'][0]['average'],
                            '@timestamp': currenttime,
                            }
        logging.info(cloudmongooscanandOrderRs12s2)

        indexname = env + '-cloudmongo-scanandorder'

        Rs12s1data_dict = {'_op_type': 'index',
                           '_index': indexname,
                           '_source': cloudmongooscanandOrderRs12s1}
        logging.info(Rs12s1data_dict)
        Rs12s2data_dict = {'_op_type': 'index',
                           '_index': indexname,
                           '_source': cloudmongooscanandOrderRs12s2}
        logging.info(Rs12s2data_dict)

        cloudmongoscanandorders.append(Rs12s1data_dict)
        cloudmongoscanandorders.append(Rs12s2data_dict)
        print(cloudmongoscanandorders)
        try:
            print("before es bulk indexing")
            helpers.bulk(client=es, actions=cloudmongoscanandorders)
            print("after es bulk indexing")
        except Exception as ex:
            logging.exception(ex)
            es.indices.refresh()
            cloudmongoscanandorders = []
            exec_endtime = datetime.utcnow()
            total_exec_time = abs(exec_endtime-exec_starttime).seconds
    except Exception as ex:
        logging.exception("message")
    finally:
        time.sleep(59)
logging.info('End')

>>>>>>>>>>>>>>>>

<generic-dialog-view
    [(loading)]="loading"
    (close)="onClose()"
    [formGroup]="addScheduleForm"
(ngSubmit)="save()"

>
    <ng-container modal-title-slot>
        <span *ngIf="!data.params">Add Schedule</span>
        <span *ngIf="data.params">Edit Schedule</span>

    </ng-container>
    <ng-container modal-body-slot>
    <div fxLayout="row" fxFlex="100%" fxLayoutGap="100px">
        <mat-form-field fxFlex="100">
            <input
                matInput
                placeholder="{{ 'scheduleName' | l10n }}"
                autofocus-after-view-init
                formControlName="scheduleName"
                autocomplete="off"
                [(ngModel)]="scheduleName"
                maxlength="75"
                required
                data-testid="addscheduleFormNameInput"
            />
            <mat-error *ngIf="addScheduleForm.get('scheduleName').errors?.required">
                Field can not be empty
            </mat-error>             
        </mat-form-field>
    </div></ng-container>
    <ng-container modal-body-slot>
        <div fxLayout="row" fxFlex="100%" fxLayoutGap="100px">
            <mat-form-field fxFlex="100">
                <mat-select
                    formControlName="scenarioName"
                    placeholder="{{ 'scenarioName' | l10n }}"
                    [(ngModel)]="scenarioName"
                    data-testid="addscheduleFormNameInput"
                    required>
                    <mat-option
                        *ngFor="let scenario of scenarios; trackBy: trackByIndex"
                        [value]="scenario.testRunConfigName">
                        {{ scenario.testRunConfigName }}
                    </mat-option>
                </mat-select>
            </mat-form-field>
        </div>
    </ng-container>
  <!--<  <ng-container modal-body-slot>
        <div fxLayout="row" fxFlex="100%" fxLayoutGap="100px">
            <date-range-picker
            [min]="minDate"
            [max]=""
            [showTime]="true"
            [enableSeconds]="true"
            (change)="onChange($event)"
            color="accent"
        ></date-range-picker>-->
        
          <!--  <input
                matInput
                [matDatepicker]="scheduleDate"
                formControlName="schedule"
                [(ngModel)]="schedule"
                placeholder="{{ 'schedule' | l10n }}"
            />
            <mat-datepicker-toggle matSuffix [for]="scheduleDate"></mat-datepicker-toggle>
            <mat-datepicker #scheduleDate disabled="false"></mat-datepicker>-->
      <!--      <date-range-picker
            [min]="minDate"
            [max]=""
            [showTime]="true"
            [enableSeconds]="true"
            (change)="onChange($event)"
            color="accent"
        ></date-range-picker>
            <mat-form-field color="accent">
                <mat-datepicker #picker [startAt]="minDate"></mat-datepicker>

                <input
                    matInput
                    id="dateRangePickerFromDate"
                    [placeholder]="'from' | l10n | titlecase"
                    [matDatepicker]="minDate"
                    [(ngModel)]="from"
                    (dateChange)="onChange($event)"
                    [min]="1638428459"
                    [max]="max"
                    data-testid="dateRangePickerFromInput"
                />
                <mat-datepicker [panelClass]="customDatePickerClass" #fromPicker color="accent"></mat-datepicker>
            </mat-form-field>
            <time-picker
                [date]="from"
                [enableSeconds]="true"
                [matDatepicker]="fromPicker"
            ></time-picker>
            <mat-datepicker-toggle
                [for]="fromPicker"
                color="accent"
                data-testid="dateRangePickerFromToggle"
            ></mat-datepicker-toggle>-->
           <!-- <mat-form-field color="accent">
                <mat-datepicker #picker [startAt]="minDate"></mat-datepicker>

                <input
                    matInput
                    id="dateRangePickerFromDate"
                    [placeholder]="'from' | l10n | titlecase"
                    [matDatepicker]="fromPicker"
                    [(ngModel)]="schedule"
                    (dateChange)="onChange($event)"
                    [min]="1638428459"
                    [max]="max"
                    data-testid="dateRangePickerFromInput"
                />
                <mat-datepicker [panelClass]="customDatePickerClass" #fromPicker color="accent"></mat-datepicker>
            </mat-form-field>
            <time-picker
                [date]="schedule"
                [enableSeconds]="true"
                [matDatepicker]="fromPicker"
            ></time-picker>
            <mat-datepicker-toggle
                [for]="fromPicker"
                color="accent"
                data-testid="dateRangePickerFromToggle"
            ></mat-datepicker-toggle>
              
    </div>
    </ng-container>
    <ng-container modal-body-slot>
        <mat-form-field appearance="fill">
            <mat-label>Custom calendar header</mat-label>
            <input formControlName="date" matInput [matDatepicker]="picker">
            <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
            <mat-datepicker #picker [calendarHeaderComponent]="timeHeader"></mat-datepicker>
        </mat-form-field>
    </ng-container>-->
    <ng-container modal-body-slot>
        <mat-datetimepicker-toggle [for]="entranceDateTimePicker" matSuffix></mat-datetimepicker-toggle>
        <mat-datetimepicker #entranceDateTimePicker type="datetime" openOnFocus timeInterval="5"></mat-datetimepicker>
        <input
          matInput
          (dateInput)="attendance = $event.value.format('x')"
          [(ngModel)]="attendance"
          [matDatetimepicker]="entranceDateTimePicker"
          required
          autocomplete="false"
        />
    </ng-container>
   <!-- <ng-container modal-body-slot>
        <mat-form-field>
            <mat-placeholder>Start DateTime</mat-placeholder>
            <mat-datetimepicker-toggle [for]="datetimePicker" matSuffix></mat-datetimepicker-toggle>
            <mat-datetimepicker
              #datetimePicker
              type="datetime"
              openOnFocus="true"
              timeInterval="5">
            </mat-datetimepicker>
            <input
              matInput
              formControlName="start"
              [matDatetimepicker]="datetimePicker"
              required
              autocomplete="false">
          </mat-form-field>
    </ng-container>-->
</generic-dialog-view>



<ng-container modal-body-slot>
        <div fxLayout="row" fxFlex="100%" fxLayoutGap="100px">
            <mat-form-field  fxFlex="100">
                <input matInput [ngxMatDatetimePicker]="picker" 
                placeholder="Choose a date & time"
                formControlName="schedule"
                 [(ngModel)]="schedule">
    
                <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>

                <ngx-mat-datetime-picker #picker [enableMeridian]="true"></ngx-mat-datetime-picker>
            </mat-form-field>
            <mat-form-field>
                <input matInput [ngxMatDatetimePicker]="picker" 
                                placeholder="Choose a date" 
                                [formControl]="dateControl"
                                [min]="minDate" [max]="maxDate" 
                                [disabled]="disabled">
                <mat-datepicker-toggle matSuffix [for]="picker">
                </mat-datepicker-toggle>
                <ngx-mat-datetime-picker #picker 
                  [showSpinners]="showSpinners" 
                  [showSeconds]="showSeconds"
                  [stepHour]="stepHour" [stepMinute]="stepMinute" 
                  [stepSecond]="stepSecond"
                  [touchUi]="touchUi"
                  [color]="color">
                </ngx-mat-datetime-picker>
              </mat-form-field>
              <mat-form-field>
                <input matInput [ngxMatDatetimePicker]="picker"
                [(ngModel)]="schedule"
                formControlName="schedule"
                                placeholder="Choose a date" 
                                />
                <mat-datepicker-toggle matSuffix [for]="picker">
                </mat-datepicker-toggle>
                <ngx-mat-datetime-picker #picker 
                  [showSpinners]="true" 
                  [showSeconds]="true"
                  [stepHour]="true" [stepMinute]="true" 
                  [stepSecond]="true"
                  [touchUi]="true"
                  [color]="blue"
                  [enableMeridian]="true">
                </ngx-mat-datetime-picker>
              </mat-form-field>
        </div>
    </ng-container>
    <ng-container modal-body-slot>
        <mat-datetimepicker-toggle [for]="entranceDateTimePicker" matSuffix></mat-datetimepicker-toggle>
        <mat-datetimepicker #entranceDateTimePicker type="datetime" openOnFocus timeInterval="5"></mat-datetimepicker>
        <input
          matInput
          (dateInput)="attendance = $event.value.format('x')"
          [(ngModel)]="schedule"
          [matDatetimepicker]="entranceDateTimePicker"
          required
          autocomplete="false"
        />
    </ng-container>
    <ng-container modal-body-slot>
        <mat-form-field>
            <mat-placeholder>Start DateTime</mat-placeholder>
            <mat-datetimepicker-toggle [for]="datetimePicker" matSuffix></mat-datetimepicker-toggle>
            <mat-datetimepicker
              #datetimePicker
              type="datetime"
              openOnFocus="true"
              timeInterval="5"
              enableSeconds="true"
              enableMeridian="true">
            </mat-datetimepicker>
            <input
              matInput
              formControlName="schedule"
              format="y-mm-dd HH:MM:ss"
              [matDatetimepicker]="datetimePicker"
              required
              [showSeconds]="true"
              autocomplete="false">
          </mat-form-field>
    </ng-container>
    <ng-container modal-body-slot>
        <mat-form-field style="width: 100%">
            <input matInput [matDatetimepicker]="datetimePicker" name="outTime" [(ngModel)]="schedule" autocomplete="false" [max]="curTime"  placeholder="Date time" >
            <mat-datetimepicker-toggle [for]="datetimePicker" matSuffix></mat-datetimepicker-toggle>
            <mat-datetimepicker #datetimePicker type="datetime" openOnFocus="true" timeInterval="1" [showSeconds]="true" [format]="yyyy-MM-ddTHHmmss"></mat-datetimepicker>
        </mat-form-field>
    </ng-container>
    <ng-container modal-body-slot>
        <mat-form-field>
            <input matInput [ngxTimepicker]="endTime" [format]="24"  placeholder="{{placeholderTime}}" formControlName="schedule" />
          </mat-form-field>
          <ngx-material-timepicker #endTime (timeSet)="timeChange($event)" [minutesGap]="10"></ngx-material-timepicker>
       
          <mat-form-field>
            <input id="pickerId" matInput [matDatepicker]="datepicker" placeholder="{{placeholderDate}}"
                   [min]="" [max]="" [showSeconds]="true" (dateChange)="dateChange($event)">
            <mat-datepicker-toggle matSuffix [for]="datepicker"></mat-datepicker-toggle>
            <mat-datepicker #datepicker [disabled]="false" [touchUi]="" startView="{{schedule}}"></mat-datepicker>
          </mat-form-field>
    </ng-container>
    <ng-container modal-body-slot>
        <mat-form-field>
            <input matInput [ngxMatDatetimePicker]="picker1" 
            placeholder="Choose a date" formControlName="date">
            <mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
            <ngx-mat-datetime-picker #picker1></ngx-mat-datetime-picker>
          </mat-form-field>
    </ng-container>
    <ng-container modal-body-slot>
          <div class="text-danger" >Active End Date is required.</div>
  <div  class="text-danger">Active End Date must be a valid date.</div>
  <input matInput [ngxMatDatetimePicker]="picker" 
  placeholder="Choose a date" formControlName="schedule">
  <ngx-mat-datetime-picker #picker [enableMeridian]="true"></ngx-mat-datetime-picker>
  <ngx-mat-timepicker 
  [(ngModel)]="schedule" [disabled]="false" 
  [showSpinners]="true"
  [stepHour]="true" [stepMinute]="true" 
  [stepSecond]="true" 
  [showSeconds]="true"
  [enableMeridian]="true" >
</ngx-mat-timepicker>
    </ng-container>
    <mat-form-field>
        <input matInput [ngxMatDatetimePicker]="picker" placeholder="Choose a date"
           [min]="" [max]="" [disabled]="false">
        <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
        <ngx-mat-datetime-picker #picker [showSpinners]="true" [showSeconds]="true"
           [stepHour]="true" [stepMinute]="true" [stepSecond]="true"
           [touchUi]="" [color]="color" [enableMeridian]="true" 
           [disableMinute]="false" [hideTime]="false">
        </ngx-mat-datetime-picker>
     </mat-form-field>
     <ng-container modal-body-slot>
        <mat-form-field>
            <input matInput [ngxMatDatetimePicker]="picker" placeholder="Choose a date" 
               [min]="minDate" [max]="maxDate" >
            <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
            <ngx-mat-datetime-picker #picker [showSpinners]="showSpinners" [showSeconds]="showSeconds"
               [stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond">
            </ngx-mat-datetime-picker>
         </mat-form-field>
     </ng-container>
     <ng-container modal-body-slot>
        <ngx-datetime-picker
      ></ngx-datetime-picker>
       
      <ngx-date-picker ></ngx-date-picker>
       
      <ngx-time-picker ></ngx-time-picker>
       
      Additional options for each picker: [disableButton]="false" (default)
      [disableInput]="false" (default) [disablePicker]="false" (default)
      [doNotCloseOnDateSet]="false" (default) Additional options for ngx-date-picker
      and ngx-datetime-picker: [min]="null" (default) [max]="null" (default)
      Additional options for ngx-time-picker and ngx-datetime-picker:
      [use24HourClock]="false" (default)
     </ng-container>
     <ng-container modal-body-slot>
        <mat-form-field class="example-full-width" appearance="fill">
            <mat-label>Choose a date</mat-label>
            <input matInput [matDatepicker]="picker">
            <mat-datepicker #picker></mat-datepicker>
         </mat-form-field>
         <button mat-raised-button (click)="picker.open()">Open</button>
     </ng-container>
     <ng-container modal-body-slot>
        <mat-form-field>
            <input
                matInput
                [matDatepicker]="pick"
                formControlName="schedule"
                (click)="pick.open()"
                placeholder="pick"
            />
          
            <mat-datepicker-toggle matSuffix [for]="pick">
            </mat-datepicker-toggle>
            <mat-datepicker
                #pick
                disabled="false"
            ></mat-datepicker>
        </mat-form-field>
          <ngx-mat-timepicker 
            [(ngModel)]="schedule" [disabled]="false" 
            [showSpinners]="true"
            [stepHour]="true" [stepMinute]="true" 
            [stepSecond]="true" 
            [showSeconds]="true"
            [enableMeridian]="true" >
        </ngx-mat-timepicker>
{{schedule}}
     </ng-container>


(selectionChange)="dateFormat(schedule)"


npm i @angular-material-components/moment-adapter

>>>>>>>>>>>>>>>>>>

test.py:

#!/usr/bin/env python3
import json
import base64

import requests as req

passwod = 'c3VrdW1hcjpGdW4yNjIzMTYxNCE='
user = 'spkannan'
pwd =  "Basic " + base64.b64encode(b'spkannan@ghx.com:5rq3Gmwq1TidbCq4pB1l94EF').decode("utf-8") 
passwd = 'Bearer $2a$07$itTXgVhtaXEPtzIV6LhcWea3FX/rNdwQHf/jnunFxh2LzkjE4iRCy'
password = 'eyJraWQiOiJyc2ExIiwiYWxnIjoiUlMyNTYifQ.eyJzdWIiOiJzcGthbm5hbiIsImF1ZCI6WyI2YWY0YzZkMy01NzlhLTRhMzItODIxZC0wNTNmOGZlMmI2N2QiLCI5YWFhMTM1My0xY2E1LTRjNjItOTExMS1kYWFkZTE4ZTYxOWUiLCI1MTRkZDk5MGZkMTkzNzJiNjFhZTMwYWY2MjRlZDIxYyJdLCJhenAiOiI1MTRkZDk5MGZkMTkzNzJiNjFhZTMwYWY2MjRlZDIxYyIsImlzcyI6Imh0dHBzOlwvXC9sb2dpbi1kZXYuYXdzZHNpLmdoeC5jb21cL2lkZW50aXR5LXNlcnZpY2VcLyIsInBoIjoiRXhjaGFuZ2VTdXBwb3J0IiwiZXhwIjoxNjM2NDA3Mzg2LCJpYXQiOjE2MzY0MDYxODYsImp0aSI6IjM5NjQwNTBhLTQ1YjgtNGRiMi04OTdjLTA4NTE0Zjk4ODc2YyJ9.JrNfVRNpR6AbMmEU9xW6-HFbqdTLyNpJeBKOO3vnFMqeC89F4KzW8F6AaQPaURs8t_uuwcM1ffwkdmkTMojSZ5jWioPbYX1OyDvQ3UY_UHCBKcg4SJefa35gUtelTnYPpITuyxFeF5v5fTsPXQzxK7cN_8h1ulNf2oR_zCop0y4'

resp = req.get("https://workflow.ghx.com/rest/api/2/search?jql=key=EGXC-36165",auth=('spkannan','Corex@tfw123'))
'''resp = req.get("https://workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query=CXTF-",headers = {'Bearer': password})'''
print(resp.status_code)
'''if resp.status_code == 200:
    response_json = resp.json()
    print(response_json)
    issues = response_json['issues']
    print(issues)
    for issue in issues:
        if issue['key']:
            print(issue['key'])
            print(issue['fields']['summary'])
            break;'''
'''if fields.has_key('subtasks'):
    for subtask in issue['fields']['subtasks']:
        print(subtask)'''
'''import requests as req
user = 'spkannan'
passwd = 'Corex@tfw123'

resp = req.get("https://workflow.ghx.com/rest/api/2/issue/647790",headers = {'Content-Type' : 'application/json'}, auth=(user, passwd))
print(resp.status_code)
if resp.status_code == 200:
    issue = resp.json()
    fields = issue['fields']
    print(fields)
if fields.has_key('subtasks'):
    for subtask in issue['fields']['subtasks']:
        print(subtask)'''
'''import resource

url = 'https://workflow.ghx.com/rest/api/2/search?jql=assignee=spkannan'
url1 = 'https://workflow.ghx.com'
resource = Resource(url1 + '/rest/api/2/issue/%s' % key, filters=[auth])
response = resource.get(headers = {'Content-Type' : 'application/json'})
print(response)'''
''' if response.status_int == 200:
        # Not all resources will return 200 on success. There are other success status codes. Like 204. We've read
        # the documentation though and know what to expect here.
        issue = json.loads(response.body_string())
        return issue
    else:
        return None

fields = issue['fields']
if fields.has_key('subtasks'):
    for subtask in issue['fields']['subtasks']:
        # do work with a subtaskdef get_epic_id(url, key, auth):
    resource = Resource(url + ('/rest/api/latest/issue/%s?expand=names' % key), filters=[auth])
    response = resource.get(headers={'Content-Type': 'application/json'})
    if response.status_int == 200:
        for field_id, field_name in json.loads(response.body_string())['names'].items():
            if field_name == 'Epic Link':
                return field_id
    else:
        return None'''
>>>>>>>>>>>>>>>>>>>>>>>>>

#!/usr/bin/env python3.8
'''import json
import base64
import requests as req
user = 'bamboouser'
passwd = 'P@nd@F00d'

pwd =  "Basic " + base64.b64encode(b'spkannan:P@nd@F00d').decode(" US-ASCII") 
resp = req.get("https://workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query=CXTF-",headers = {'content-type': 'application/json', 'accept': 'application/json'},auth=(user,passwd))
print(resp)
if resp.status_code == 200:
    response_json = resp.json()
    print(response_json)'''


'''import json

import requests as req
user = 'spkannan'
passwd = 'Corex@tfw123'
resp = req.get("https://workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query=CXTF-22", auth=(user, passwd))
print(resp)
if resp.status_code == 200:
    response_json = resp.json()
    sections = response_json['sections'][0]
    for issue in sections['issues']:
       print(issue['key'])'''
#!/usr/bin/env python3
import json

import requests as req
user = 'spkannan'
passwd = 'Corex@tfw123'

'''resp = req.get("https://workflow.ghx.com/rest/api/2/search?jql=project=CXTF",headers = {'Content-Type' : 'application/json'}, auth=(user, passwd))'''
resp = req.get("https://workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework AND issuekeyE-2242&currentIssueKey=CXTF-1978&showSubTasks=true&showSubTaskParent=true&appId=&query=CXTF-22&_=1634745724544", auth=(user, passwd))
print(resp.status_code)
if resp.status_code == 200:
    response_json = resp.json()
    sections = response_json['sections'][0]
for issue in sections['issues']:
    print(issue['key'])

>>>>>>>>>>>>>>>>>>>>>>>>>

training  links:

NodeJs
------
https://drive.google.com/file/d/1JuvpxujH1LhzvLeMnXx23EC39IHZ1WGq/view?usp=sharing
https://drive.google.com/file/d/1Qr_J-OgwG29MfbDYiCKpbJ2Xpev9U24M/view?usp=sharing
https://drive.google.com/file/d/1oPTR9dtSJM8ypisK2cFp6uBTm_1Q9DIa/view?usp=sharing

React
-------
https://drive.google.com/file/d/1dm6oq_sZa8LfEQMnjbXWsmIDzEef6Jft/view?usp=sharing
https://drive.google.com/file/d/1lreq2SVTIxpI4KhgvjGMzZd_UFRDdUd_/view?usp=sharing
https://drive.google.com/file/d/1vjn9VMlEX9uSJ0QkD4ZGQ2TMl8v5W4Iu/view?usp=sharing
https://drive.google.com/file/d/1cNfhwJ_VCvasJbOx6bb53LMKs8hyg_dD/view?usp=sharing


mongo

https://drive.google.com/file/d/1h5wPxBXNIAFjr_l8iegP6UkPL5UFv5fE/view?usp=sharing
https://drive.google.com/file/d/1mkq5Pj2bOKwaSJ-ELrVaaUMroGeBeCsb/view?usp=sharing
https://drive.google.com/file/d/1wjjDlYls0ZWYlKWVpXZuLs4AMjZ9wKH_/view?usp=sharing
https://drive.google.com/file/d/1rnjIS2PhTcFr-ln8WXNCe1E_fQ1Jwv0I/view?usp=sharing
https://drive.google.com/file/d/1YTmYydpgTA_clrYpiAJEzblBrD8RbnLd/view?usp=sharing
https://drive.google.com/file/d/1Swf_7CM7vMFQtgtdPk1vdUSiSAwsxjgX/view?usp=sharing
https://drive.google.com/file/d/1qofPlO44T2y_jq3iikBG5iPbvY86H1-G/view?usp=sharing


microservice

https://meet.google.com/mse-ttxx-nxz
07.05.2020 Day 3 - Recorded Video URL https://drive.google.com/drive/folders/0BzU2HFaR9oV5fkd6QThwSGN4MHlpX1RaQ2tsRzUxcVBUb0s5d2JvQmsxN29XdmE2a0RHMEk?usp=sharing
https://drive.google.com/drive/folders/0BzU2HFaR9oV5fkd6QThwSGN4MHlpX1RaQ2tsRzUxcVBUb0s5d2JvQmsxN29XdmE2a0RHMEk?usp=sharing
Sabarinathan, 17:44
Micoservice Development Setup
1. Install Jhipster - https://www.jhipster.tech/configuring-ide/
2. Please walk through the  JDL - https://www.jhipster.tech/jdl/applications
3. Design the JDL for your application.

https://www.jhipster.tech/configuring-ide/

https://www.jhipster.tech/jdl/applications

Sivakumar Ji, JHipster -> Java Hipster -> So, we should use other frameworks like Django for python which does limited for web app development.
JHipster Application Generator builds (frameworks it support)
https://www.jhipster.tech/modules/official-blueprints/

https://drive.google.com/open?id=1vvO5w9mkhWAjgBmkhedHWWo5anp_mVr5

All recordings

https://drive.google.com/open?id=1vvO5w9mkhWAjgBmkhedHWWo5anp_mVr5

Please find the jdl file, Which have used in the session.

run command - where you want to generate the applications
> jhipster import-jdl <location>/ecommerce.jdl

https://docs.docker.com/get-docker/
https://drive.google.com/file/d/1S8HvoKDFsHIkhmt7MAxXYpTAybo7mQOi/view

https://drive.google.com/file/d/1_bEbdE3vi-EvC9KyQe65_GhD6tRHmEm2/view?usp=sharing

https://drive.google.com/file/d/1_bEbdE3vi-EvC9KyQe65_GhD6tRHmEm2/view

https://drive.google.com/file/d/1KZsr7gZjrm9PwlBadmCujC9eIfHgeCpm/view?usp=drivesdk

https://drive.google.com/file/d/1NgRK5qydWeFdNG6rkr9NBEpxOpjOlkVw/view

https://drive.google.com/folderview?id=1vvO5w9mkhWAjgBmkhedHWWo5anp_mVr5

http://128.199.223.27/smi-training/microservices-training-batch-1

Copy SSH clone URL
git@128.199.223.27:smi-training/microservices-training-batch-1.git

http://128.199.223.27/smi-training/microservices-training-batch-1.git

http://128.199.223.27/smi-training/microservices-training-batch-1.git

https://drive.google.com/folderview?id=1vvO5w9mkhWAjgBmkhedHWWo5anp_mVr5

https://drive.google.com/drive/folders/1vvO5w9mkhWAjgBmkhedHWWo5anp_mVr5?usp=sharing

>>>>>>>>>>>>>>>>>



 private void runScenario(Entry<String, List> scnWithSchedule, TestRunCheckList testRunCheckList)
            throws TestFWServerException, TestFWResourceNotFoundException, InterruptedException, ExecutionException {
    if (Boolean.parseBoolean(TFConfigKeys.POST_FOR_RUN.getValue())) {
            scenarioService.runScenario(scnWithSchedule.getKey(), testRunCheckList);
    } else {
            TFHostnameVerifier tfHostnameVerifier = new TFHostnameVerifier();
            CloseableHttpResponse response = null;
            CloseableHttpClient client = HttpClients.custom().setSSLHostnameVerifier(tfHostnameVerifier)
                            .setSSLContext(new TFClientHttpRequestFactory(tfHostnameVerifier).trustSelfSignedSSL()).build();
            String url = TFConfigKeys.TFW_HEIMDALL_HOSTNAME.getValue()
                            + TFConfigKeys.TEST_SCENARIO_BASE_REST_URL.getValue() + scnWithSchedule.getKey()
                            + TFConfigKeys.RUN_ISDUPLICATE_SCENARIO_URL.getValue();
            HttpGet get = new HttpGet(url);
            try {
                    response = client.execute(get);
                    LOGGER.debug("Response with Entity: {} Response Status Code: {}", response.getEntity(),
                                    response.getStatusLine().getStatusCode());
            } catch (IOException ex) {
                    final String errMsg = String.format("Error occured while calling Test Run. Error was: %s",
                                    ex.getMessage());
                    LOGGER.error(errMsg);
            } finally {
                    IOUtils.closeQuietly(response);

                    try {
                            if (response != null) {
                                    response.close();
                            }
                            if (client != null) {
                                    client.close();
                            }
                    } catch (IOException e) {
                            final String errMsg = String
                                            .format("Error occured while closing Response and Client. Error was: %s", e.getMessage());
                            LOGGER.error(errMsg);
                    }
            }
    }
>>>>>>>>>>>>>>>>>>


'''import base64
message = "cigztdwr"
message_bytes = message.encode('ascii')
base64_bytes = base64.b64encode(message_bytes)
base64_message = base64_bytes.decode('ascii')

print(base64_message)

base64_message = 'Y2lnenRkd3I='
base64_bytes = base64_message.encode('ascii')
message_bytes = base64.b64decode(base64_bytes)
message1 = message_bytes.decode('ascii')

print(message1)

message = "b68db372-6ff0-4e02-907a-534563785cde"
message_bytes = message.encode('ascii')
base64_bytes = base64.b64encode(message_bytes)
base64_message = base64_bytes.decode('ascii')

print(base64_message)

base64_message = 'YjY4ZGIzNzItNmZmMC00ZTAyLTkwN2EtNTM0NTYzNzg1Y2Rl'
base64_bytes = base64_message.encode('ascii')
message_bytes = base64.b64decode(base64_bytes)
message1 = message_bytes.decode('ascii')

print(message1)

base64_message = '3svUzpu2DcoKGNzi1P6fs_TQf1SR27bx'
base64_bytes = base64_message.encode('ascii')
message_bytes = base64.b64decode(base64_bytes)
message1 = message_bytes.decode('ascii')
print(message1)'''


>>>>>>>>

cloudmongo python

#!/usr/bin/python
"""
collects cloud mongo event bus scan and order metric details and push to ES
"""
import json
import time
import logging
import requests
import re
from requests import get
from requests.auth import HTTPDigestAuth
from datetime import datetime, timedelta
#from elasticsearch import Elasticsearch, helpers

mms_public_key = 'cigztdwr'
mms_private_key = 'b68db372-6ff0-4e02-907a-534563785cde'

GHX_DEV = '5373a8689194bf134f7a93ad'

'''configuration = {}
def load_config(configobj, cfile):
    """load configuration details"""
    f = open(cfile, 'r')
    for line in f:
        line = line.strip()
        (param, value) = re.split(':', line, maxsplit=1)
        configobj[param] = value
    f.close()
    return configobj

load_config(configuration, '/opt/conf/cf-params.txt')

def set_subdomain(metaobj):
    """set sub domain details"""
    if metaobj['accountId'] == "050190852521":
        subd = 'awsdsi.ghx.com'
    else:
        subd = 'awsprd.ghx.com'
    return subd

meta = json.loads(get('http://169.254.169.254/latest/dynamic/'\
                      +'instance-identity/document/').content)
instance_id = meta['instanceId']
hostname = meta['privateIp']

subdomain = set_subdomain(meta)

es = Elasticsearch(['http://' + meta['region'] + '-testframework-es.'\
                    + subdomain + ':80'])'''

def get_clusters(group_id):
    """ pulls data from mms api - by group"""
    r = requests.get('https://cloud.mongodb.com/api/public/v1.0/groups/'\
                     +group_id+'/clusters?',
                     headers={'Accept': 'application/json'},
                     auth=HTTPDigestAuth(mms_public_key, mms_private_key))
    r_json = r.json()
    return r_json['results']

def get_host_with_clusterid(group_id, cluster_id):
    r = requests.get('https://cloud.mongodb.com/api/public/v1.0/groups/'\
                     +group_id+'/hosts?clusterId='+cluster_id,
                     headers={'Accept': 'application/json'},
                     auth=HTTPDigestAuth(mms_public_key, mms_private_key))
    r_json = r.json()
    return r_json['results']

def get_with_meastype_granular_duration(href,granularity,starttime,endtime,
                                        measurementtype,hostname):   
    r = requests.get(href+'/measurements?granularity='+granularity+'&start='\
                         +starttime+'&end='+endtime+'&m='+measurementtype+\
                         '&processId='+hostname+'&pretty=true',
                         headers={'Accept': 'application/json'},
                         auth=HTTPDigestAuth(mms_public_key, mms_private_key))
    r_json = r.json()
    return r_json['measurements']

count = 0
total_exec_time = 0
#environment = configuration['GHXEnvironment'].lower()

dateTag = datetime.now().strftime("%Y-%b-%d")
LOG_FILENAME = '/var/log/cloudmetric/cloudmongometriccollection.log_%s.log'
logging.basicConfig(filename=LOG_FILENAME % dateTag, level=logging.INFO)
logging.info('Started')
#while True:
#try:
#while True:
try:
    count += 1
    result_cluster_details = get_clusters(GHX_DEV)
    #print("The result of Cluster is:%s",result_cluster_details)
    clusterid=[]
    hostnameandhref={}
    hostreplicawithip={}

    hostname_with_value_scan_and_order={}
    hostname_with_opcount_query={}
    
    cloudmongoscanandorders = []
    cloudmongoopcounterqueries = []
    now = datetime.utcnow()
    fromdate = (now - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:%S")\
         + "Z"
    todate = now.strftime("%Y-%m-%dT%H:%M:%S") + "Z"
    exec_starttime = datetime.utcnow()
    logging.info(count)
    for id, element in enumerate(result_cluster_details):
       if element["clusterName"] == "event-bus-stg-sharded-cluster"\
       and element["typeName"] == "REPLICA_SET" :
    #        print("NNNNN",element["id"])
           clusterid.append(element["id"])
    #print("The cluster id is :%s",clusterid)
    for clus_id in clusterid:
    #    print("the cluster id",clus_id)
            result_host_details = get_host_with_clusterid(GHX_DEV, clus_id)
    #    print("The result of host is:%s",result_host_details)
            for element in result_host_details:
            replicawithip = []
                replicawithip.append(element["ipAddress"])
                replicawithip.append(element["replicaSetName"])
                if element["hostname"] not in hostreplicawithip:
                   hostreplicawithip[element["hostname"]] = replicawithip

                r = element["hostname"]
                hostnameandhref[r] = element["links"]  
                for ref in element["links"]:
    #            print("The href is :%s",ref["href"])
                    hostnameandhref[r] = ref["href"]
                    #print(hostnameandhref)
    for key in hostnameandhref:
        scan_order = get_with_meastype_granular_duration(
                hostnameandhref[key],"PT10S",\
                fromdate,\
                todate,\
                "OPERATIONS_SCAN_AND_ORDER",key)
                    #print(">>>>>>>>>>>>scan_order")
        for datapoint in scan_order:
                            #print(">>>>>>>>>>>>scan_order:%s",datapoint["dataPoints"])
            for timevalue in datapoint["dataPoints"]:
                #print("scanandorder: key%s time%s value%s",key,timevalue["timestamp"],timevalue["value"]) 
                if isinstance(timevalue["value"], float):
                cloudmongoscanandorder = {"granularity": 'PT10S',
                                            "ipwithhostname": hostreplicawithip[key][0]+"-"+key,
                                            "clusterName":"event-bus-stg-sharded-cluster",
"replicaset":hostreplicawithip[key][1],
                                            "measurement_type":"OPERATIONS_SCAN_AND_ORDER",
                                            "value": timevalue["value"],
                                            "@timestamp": timevalue["timestamp"]}
                #logging.info(cloudmongoscanandorder)
                print cloudmongoscanandorder
                '''indexname = environment + '-cloudmongo-scanandorder'
                data_dict = {
                        '_op_type': 'index',
                        '_index': indexname,
                        '_source': cloudmongoscanandorder
                        }
                logging.info(data_dict)
                cloudmongoscanandorders.append(data_dict)'''
        opcounter = get_with_meastype_granular_duration(
                hostnameandhref[key],"PT10S",\
                        fromdate,\
                        todate,\
                        "OPCOUNTER_QUERY",key)
                        #print(">>>>>>>>>>>>opcounter")
        for datapoint in opcounter:
                            #print(">>>>>>>>>>>>opcounter:%s",datapoint["dataPoints"])
            for timevalue in datapoint["dataPoints"]:
                                #print timevalue 
                #print("opcounter: key%s time%s value%s",key,timevalue["timestamp"],timevalue["value"]) 
                if isinstance(timevalue["value"], float):
                cloudmongoopcounterquery = {"granularity": 'PT10S',
                                            "ipwithhostname": hostreplicawithip[key][0]+"-"+key,
                                            "clusterName":"event-bus-stg-sharded-cluster",
"replicaset":hostreplicawithip[key][1],
                                            "measurement_type":"OPCOUNTER_QUERY",
                                            "value": timevalue["value"],
                                            "@timestamp": timevalue["timestamp"]}
                #logging.info(cloudmongoopcounterquery)
                print cloudmongoopcounterquery
                '''indexname = environment + '-cloudmongo-opcounter-query'
                data_dict = {
                        '_op_type': 'index',
                        '_index': indexname,
                        '_source': cloudmongoopcounterquery
                        }
                logging.info(data_dict)
                cloudmongoopcounterqueries.append(data_dict)
    if count >= 1:
        try:
            print "start bulk insert"
            helpers.bulk(client=es, actions=cloudmongoscanandorders)
            helpers.bulk(client=es, actions=cloudmongoopcounterqueries)
            print "end bulk insert"
        except Exception as ex:
            logging.exception(ex)
            es.indices.refresh()
            cloudmongoscanandorders = []
            cloudmongoopcounterqueries = []
            count = 0
            exec_endtime = datetime.utcnow()
            total_exec_time = abs(exec_endtime - exec_starttime).seconds'''
except Exception as ex:
    logging.exception("message")
finally:
    time.sleep(45 - total_exec_time)    
print("end")                  
logging.info('End')

>>>>>>>>>>>>

#!/usr/bin/python
"""
collects cloud mongo event bus scan and order metric details and push to ES
"""
import json
import time
import logging
import re
from datetime import datetime, timedelta
import requests
from requests import get
from requests.auth import HTTPDigestAuth
from elasticsearch import Elasticsearch, helpers


GHX_DEV = '5373a8689194bf134f7a93ad'

CONFIGURATION = {}
def load_config(configobj, cfile):
    """load configuration details"""
    files = open(cfile, 'r')
    for line in files:
        line = line.strip()
        (param, value) = re.split(':', line, maxsplit=1)
        configobj[param] = value
    files.close()
    return configobj

load_config(CONFIGURATION, '/opt/conf/cf-params.txt')

ENVIRONMENT = CONFIGURATION['GHXEnvironment'].lower()
CLOUD_MONGO_API_URL = CONFIGURATION['CloudMongoApiUrl']
MMS_PUBLIC_KEY = CONFIGURATION['CloudmongoMMSpublickey']
MMS_PRIVATE_KEY = CONFIGURATION['CloudmongoMMSprivatekey']


def set_subdomain(metaobj):
    """set sub domain details"""
    if metaobj['accountId'] == "050190852521":
        subd = 'awsdsi.ghx.com'
    else:
        subd = 'awsprd.ghx.com'
    return subd

META = json.loads(get('http://169.254.169.254/latest/dynamic/'\
                      +'instance-identity/document/').content)

SUB_DOMAIN = set_subdomain(META)

ES = Elasticsearch(['http://' + META['region'] + '-testframework-es.'\
                    + SUB_DOMAIN + ':80'])

"""
get clusters  present in project with group id
"""
def get_clusters(group_id):
    """ pulls data from mms api - by group"""
    response = requests.get(CLOUD_MONGO_API_URL+'/'\
                                +group_id+'/clusters?',
                            headers={'Accept': 'application/json'},
                            auth=HTTPDigestAuth(MMS_PUBLIC_KEY, MMS_PRIVATE_KEY))
    r_json = response.json()
    return r_json['results']
"""
get hosts present in cluster id of cluster like event-bus-stg-sharded-cluster
"""
def get_host_with_clusterid(group_id, cluster_id):
    response = requests.get(CLOUD_MONGO_API_URL+'/'\
                     +group_id+'/hosts?clusterId='+cluster_id,
                            headers={'Accept': 'application/json'},
                            auth=HTTPDigestAuth(MMS_PUBLIC_KEY, MMS_PRIVATE_KEY))
    r_json = response.json()
    return r_json['results']
"""
get measurement count with respect to given granularity and measurementtype
with specified duration having href of host like 
CoreX-STG-db-eb-s2-01.awsdsi.ghx.com
"""
def getvalue_for_measurementtype(href, granularity, starttime, endtime,
                                 measurementtype, hostname):
    response = requests.get(href+'/measurements?granularity='+granularity+'&start='\
                         +starttime+'&end='+endtime+'&m='+measurementtype+\
                         '&processId='+hostname+'&pretty=true',
                            headers={'Accept': 'application/json'},
                            auth=HTTPDigestAuth(MMS_PUBLIC_KEY, MMS_PRIVATE_KEY))
    r_json = response.json()
    return r_json['measurements']

COUNT = 0
TOTAL_EXEC_TIME = 0

DATE_TAG = datetime.now().strftime("%Y-%b-%d")
LOG_FILENAME = '/var/log/cloudmetric/cloudmongometriccollection.log_%s.log'
logging.basicConfig(filename=LOG_FILENAME % DATE_TAG, level=logging.INFO)
logging.info('Started')
while True:
    try:
        COUNT += 1
        CLUSTER_DETAILS = get_clusters(GHX_DEV)
        CLUSTER_ID = []
        HOSTNAME_AND_HREF = {}
        HOSTNAME_WITH_REPLICA_AND_IP = {}

        CLOUD_MONGO_SCAN_AND_ORDERS = []
        CLOUD_MONGO_OPCOUNTER_QUERIES = []
        NOW = datetime.utcnow()
        FROM_DATE = (NOW - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:%S")\
            + "Z"
        TO_DATE = NOW.strftime("%Y-%m-%dT%H:%M:%S") + "Z"
        EXEC_STARTTIME = datetime.utcnow()
        logging.info(COUNT)

        for id, element in enumerate(CLUSTER_DETAILS):
            if element["clusterName"] == "event-bus-stg-sharded-cluster"\
           and element["typeName"] == "REPLICA_SET":
                CLUSTER_ID.append(element["id"])
        for clus_id in CLUSTER_ID:
            result_host_details = get_host_with_clusterid(GHX_DEV, clus_id)
            for element in result_host_details:
                replicawithip = []
                replicawithip.append(element["ipAddress"])
                replicawithip.append(element["replicaSetName"])
                if element["hostname"] not in HOSTNAME_WITH_REPLICA_AND_IP:
                    HOSTNAME_WITH_REPLICA_AND_IP[element["hostname"]] = \
                    replicawithip
                r = element["hostname"]
                HOSTNAME_AND_HREF[r] = element["links"]
            for ref in element["links"]:
                HOSTNAME_AND_HREF[r] = ref["href"]
        for key in HOSTNAME_AND_HREF:
            scan_order = getvalue_for_measurementtype(
                HOSTNAME_AND_HREF[key], "PT10S",\
                    FROM_DATE,\
                    TO_DATE,\
                    "OPERATIONS_SCAN_AND_ORDER", key)
            for datapoint in scan_order:
                for timevalue in datapoint["dataPoints"]:
                    if isinstance(timevalue["value"], float):
                        cloudmongoscanandorder = {"granularity": 'PT10S',
                                                  "ipwithhostname":\
                                                     HOSTNAME_WITH_REPLICA_AND_IP[key][0]\
                                                     +"-"+key,
                                                  "clusterName":\
                                                  "event-bus-stg-sharded-cluster",
                                                  "replicaset":\
                                                  HOSTNAME_WITH_REPLICA_AND_IP[key][1],
                                                  "measurement_type":"OPERATIONS_SCAN_AND_ORDER",
                                                  "value": timevalue["value"],
                                                  "@timestamp": timevalue["timestamp"]}
                        logging.info(cloudmongoscanandorder)
                        indexname = ENVIRONMENT + '-cloudmongo-scanandorder'
                        data_dict = {
                            '_op_type': 'index',
                            '_index': indexname,
                            '_source': cloudmongoscanandorder
                            }
                        logging.info(data_dict)
                        CLOUD_MONGO_SCAN_AND_ORDERS.append(data_dict)
            opcounter = getvalue_for_measurementtype(
                HOSTNAME_AND_HREF[key], "PT10S",\
                            FROM_DATE,\
                            TO_DATE,\
                            "OPCOUNTER_QUERY", key)
            for datapoint in opcounter:
                for timevalue in datapoint["dataPoints"]:
                    if isinstance(timevalue["value"], float):
                        cloudmongoopcounterquery = {"granularity": 'PT10S',
                                                    "ipwithhostname":\
                                                    HOSTNAME_WITH_REPLICA_AND_IP[key][0]+"-"+key,
                                                    "clusterName":"event-bus-stg-sharded-cluster",
                                                    "replicaset":\
                                                    HOSTNAME_WITH_REPLICA_AND_IP[key][1],
                                                    "measurement_type":"OPCOUNTER_QUERY",
                                                    "value": timevalue["value"],
                                                    "@timestamp": timevalue["timestamp"]}
                        logging.info(cloudmongoopcounterquery)
                        indexname = ENVIRONMENT + '-cloudmongo-opcounter-query'
                        data_dict = {
                            '_op_type': 'index',
                            '_index': indexname,
                            '_source': cloudmongoopcounterquery
                            }
                        logging.info(data_dict)
                        CLOUD_MONGO_OPCOUNTER_QUERIES.append(data_dict)
        if COUNT >= 1:
            try:
                print "start bulk insert"
                helpers.bulk(client=ES, actions=CLOUD_MONGO_SCAN_AND_ORDERS)
                helpers.bulk(client=ES, actions=CLOUD_MONGO_OPCOUNTER_QUERIES)
                print "end bulk insert"
            except Exception as ex:
                logging.exception(ex)
                ES.indices.refresh()
                CLOUD_MONGO_SCAN_AND_ORDERS = []
                CLOUD_MONGO_OPCOUNTER_QUERIES = []
                COUNT = 0
                EXEC_ENDTIME = datetime.utcnow()
                TOTAL_EXEC_TIME = abs(EXEC_ENDTIME - EXEC_STARTTIME).seconds
    except Exception as ex:
        logging.exception("message")
    finally:
        time.sleep(45 - TOTAL_EXEC_TIME)
logging.info("end")

>>>>>>>>>


#!/usr/bin/python
"""
collects cloud mongo event bus scan and order metric details and push to ES
"""
import json
import time
import logging
import re
from datetime import datetime, timedelta
import requests
from requests import get
from requests.auth import HTTPDigestAuth
from elasticsearch import Elasticsearch, helpers


GHX_DEV = '5373a8689194bf134f7a93ad'

CONFIGURATION = {}
def load_config(configobj, cfile):
    """load configuration details"""
    files = open(cfile, 'r')
    for line in files:
        line = line.strip()
        (param, value) = re.split(':', line, maxsplit=1)
        configobj[param] = value
    files.close()
    return configobj

load_config(CONFIGURATION, '/opt/conf/cf-params.txt')

ENVIRONMENT = CONFIGURATION['GHXEnvironment'].lower()
CLOUD_MONGO_API_URL = CONFIGURATION['CloudMongoApiUrl']
MMS_PUBLIC_KEY = CONFIGURATION['CloudmongoMMSpublickey']
MMS_PRIVATE_KEY = CONFIGURATION['CloudmongoMMSprivatekey']


def set_subdomain(metaobj):
    """set sub domain details"""
    if metaobj['accountId'] == "050190852521":
        subd = 'awsdsi.ghx.com'
    else:
        subd = 'awsprd.ghx.com'
    return subd

META = json.loads(get('http://169.254.169.254/latest/dynamic/'\
                      +'instance-identity/document/').content)

SUB_DOMAIN = set_subdomain(META)

ES = Elasticsearch(['http://' + META['region'] + '-testframework-es.'\
                    + SUB_DOMAIN + ':80'])

"""
get clusters  present in project with group id
"""
def get_clusters(group_id):
    """ pulls data from mms api - by group"""
    response = requests.get(CLOUD_MONGO_API_URL+'/'\
                                +group_id+'/clusters?',
                            headers={'Accept': 'application/json'},
                            auth=HTTPDigestAuth(MMS_PUBLIC_KEY, MMS_PRIVATE_KEY))
    r_json = response.json()
    return r_json['results']
"""
get hosts present in cluster id of cluster like event-bus-stg-sharded-cluster
"""
def get_host_with_clusterid(group_id, cluster_id):
    response = requests.get(CLOUD_MONGO_API_URL+'/'\
                     +group_id+'/hosts?clusterId='+cluster_id,
                            headers={'Accept': 'application/json'},
                            auth=HTTPDigestAuth(MMS_PUBLIC_KEY, MMS_PRIVATE_KEY))
    r_json = response.json()
    return r_json['results']
"""
get measurement count with respect to given granularity and measurementtype
with specified duration having href of host like 
CoreX-STG-db-eb-s2-01.awsdsi.ghx.com
"""
def getvalue_for_measurementtype(href, granularity, starttime, endtime,
                                 measurementtype, hostname):
    response = requests.get(href+'/measurements?granularity='+granularity+'&start='\
                         +starttime+'&end='+endtime+'&m='+measurementtype+\
                         '&processId='+hostname+'&pretty=true',
                            headers={'Accept': 'application/json'},
                            auth=HTTPDigestAuth(MMS_PUBLIC_KEY, MMS_PRIVATE_KEY))
    r_json = response.json()
    return r_json['measurements']

COUNT = 0
TOTAL_EXEC_TIME = 0

DATE_TAG = datetime.now().strftime("%Y-%b-%d")
LOG_FILENAME = '/var/log/cloudmetric/cloudmongometriccollection.log_%s.log'
logging.basicConfig(filename=LOG_FILENAME % DATE_TAG, level=logging.INFO)
logging.info('Started')
while True:
    try:
        COUNT += 1
        CLUSTER_DETAILS = get_clusters(GHX_DEV)
        CLUSTER_ID = []
        HOSTNAME_AND_HREF = {}
        HOSTNAME_WITH_REPLICA_AND_IP = {}

        CLOUD_MONGO_SCAN_AND_ORDERS = []
        CLOUD_MONGO_OPCOUNTER_QUERIES = []
        NOW = datetime.utcnow()
        FROM_DATE = (NOW - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:%S")\
            + "Z"
        TO_DATE = NOW.strftime("%Y-%m-%dT%H:%M:%S") + "Z"
        EXEC_STARTTIME = datetime.utcnow()
        logging.info(COUNT)

        for id, element in enumerate(CLUSTER_DETAILS):
            if element["clusterName"] == "event-bus-stg-sharded-cluster"\
           and element["typeName"] == "REPLICA_SET":
                CLUSTER_ID.append(element["id"])
        for clus_id in CLUSTER_ID:
            result_host_details = get_host_with_clusterid(GHX_DEV, clus_id)
            for element in result_host_details:
                replicawithip = []
                replicawithip.append(element["ipAddress"])
                replicawithip.append(element["replicaSetName"])
                if element["hostname"] not in HOSTNAME_WITH_REPLICA_AND_IP:
                    HOSTNAME_WITH_REPLICA_AND_IP[element["hostname"]] = \
                    replicawithip
                r = element["hostname"]
                HOSTNAME_AND_HREF[r] = element["links"]
            for ref in element["links"]:
                HOSTNAME_AND_HREF[r] = ref["href"]
        for key in HOSTNAME_AND_HREF:
            scan_order = getvalue_for_measurementtype(
                HOSTNAME_AND_HREF[key], "PT10S",\
                    FROM_DATE,\
                    TO_DATE,\
                    "OPERATIONS_SCAN_AND_ORDER", key)
            for datapoint in scan_order:
                for timevalue in datapoint["dataPoints"]:
                    if isinstance(timevalue["value"], float):
                        cloudmongoscanandorder = {"granularity": 'PT10S',
                                                  "ipwithhostname":\
                                                     HOSTNAME_WITH_REPLICA_AND_IP[key][0]\
                                                     +"-"+key,
                                                  "clusterName":\
                                                  "event-bus-stg-sharded-cluster",
                                                  "replicaset":\
                                                  HOSTNAME_WITH_REPLICA_AND_IP[key][1],
                                                  "measurement_type":"OPERATIONS_SCAN_AND_ORDER",
                                                  "value": timevalue["value"],
                                                  "@timestamp": timevalue["timestamp"]}
                        logging.info(cloudmongoscanandorder)
                        indexname = ENVIRONMENT + '-cloudmongo-scanandorder'
                        data_dict = {
                            '_op_type': 'index',
                            '_index': indexname,
                            '_source': cloudmongoscanandorder
                            }
                        logging.info(data_dict)
                        CLOUD_MONGO_SCAN_AND_ORDERS.append(data_dict)
            opcounter = getvalue_for_measurementtype(
                HOSTNAME_AND_HREF[key], "PT10S",\
                            FROM_DATE,\
                            TO_DATE,\
                            "OPCOUNTER_QUERY", key)
            for datapoint in opcounter:
                for timevalue in datapoint["dataPoints"]:
                    if isinstance(timevalue["value"], float):
                        cloudmongoopcounterquery = {"granularity": 'PT10S',
                                                    "ipwithhostname":\
                                                    HOSTNAME_WITH_REPLICA_AND_IP[key][0]+"-"+key,
                                                    "clusterName":"event-bus-stg-sharded-cluster",
                                                    "replicaset":\
                                                    HOSTNAME_WITH_REPLICA_AND_IP[key][1],
                                                    "measurement_type":"OPCOUNTER_QUERY",
                                                    "value": timevalue["value"],
                                                    "@timestamp": timevalue["timestamp"]}
                        logging.info(cloudmongoopcounterquery)
                        indexname = ENVIRONMENT + '-cloudmongo-opcounter-query'
                        data_dict = {
                            '_op_type': 'index',
                            '_index': indexname,
                            '_source': cloudmongoopcounterquery
                            }
                        logging.info(data_dict)
                        CLOUD_MONGO_OPCOUNTER_QUERIES.append(data_dict)
        if COUNT >= 1:
            try:
                print "start bulk insert"
                helpers.bulk(client=ES, actions=CLOUD_MONGO_SCAN_AND_ORDERS)
                helpers.bulk(client=ES, actions=CLOUD_MONGO_OPCOUNTER_QUERIES)
                print "end bulk insert"
            except Exception as ex:
                logging.exception(ex)
                ES.indices.refresh()
                CLOUD_MONGO_SCAN_AND_ORDERS = []
                CLOUD_MONGO_OPCOUNTER_QUERIES = []
                COUNT = 0
                EXEC_ENDTIME = datetime.utcnow()
                TOTAL_EXEC_TIME = abs(EXEC_ENDTIME - EXEC_STARTTIME).seconds
    except Exception as ex:
        logging.exception("message")
    finally:
        time.sleep(45 - TOTAL_EXEC_TIME)
logging.info("end")

>>>>>>>>


dynamo db newrelic

#!/usr/bin/python
"""
collects dynamodb metrics from newrelic and push to ES
"""
import logging
from datetime import datetime, timedelta
import requests
from requests.utils import quote

#while True:
conditional_check_failed = []
exec_starttime = datetime.utcnow()
now = datetime.utcnow()
   
currentDate = now.strftime("%Y-%m-%dT%H:%M:%S") + "+00:00"
fromdate = (now - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:%S")+"Z"  
todate = now.strftime("%Y-%m-%dT%H:%M:%S") + "Z"
exec_starttime = datetime.utcnow()
   
entity_name = quote("CONTROL_NUMBER_SEQUENCE_DEV")
nrql_cpu_es_url = "https://insights-api.newrelic.com/v1/accounts/1550954/" + "query?nrql=" \
    "SELECT average(provider.conditionalCheckFailedRequests.Average) " \
    "FROM DatastoreSample " \
    "WHERE provider='DynamoDbTable' AND entityName LIKE'" + entity_name +\
    "' SINCE '" + fromdate + "' UNTIL '" + todate + "' FACET " \
    "entityName,label.service"
nrql_cpu_es_results = requests.get(nrql_cpu_es_url,
                                   headers={"X-Query-Key" : "3svUzpu2DcoKGNzi1P6fs_TQf1SR27bx",
                                            "Accept": "application/json"})
nrql_cpu_es_results_json = nrql_cpu_es_results.json()
nrql_cpu_es_facets = nrql_cpu_es_results_json['facets']
for nrql_cpu_es_facet in nrql_cpu_es_facets:
    cpuutilization = {"user_p": nrql_cpu_es_facet['results'][0]['average'],
                      "hostname": "dynamodb-"+entity_name,
                      "metricsType": "avg-conditionalCheckFailed",
                      "@timestamp": currentDate}
    logging.debug(cpuutilization)
    data_dict = {
        '_op_type': 'index',
        '_index': "",
        '_source': cpuutilization
    }
conditional_check_failed.append(data_dict)
print conditional_check_failed

>>>>>>>>>>>>>>>>>>>>>>>>>

@Override
    public List<BuildStatus> extractBuildWithStatus(String path) {
        AmazonS3Client s3Client = new AmazonS3Client().withRegion(S3_REGION_DEV_STG_DEVINT);

        Map<String, String> keyNameList = new HashMap<>();
        List<String> prefixWithBuild = folderExtraction(TFConstants.BASE_S3_BUCKET_NAME.getValue(), s3Client, path);
        prefixWithBuild.parallelStream().forEach(folderwithVersion -> {
            keyNameList.put(folderwithVersion, path + TFConstants.FORWARD_SLASH.getValue() + folderwithVersion);
        });
        List<BuildStatus> BuildStatusDetails = Lists.newArrayList();
        getBuildStatus(keyNameList).entrySet().stream().forEach(buildStatusentry -> {
            BuildStatus buildStatus = new BuildStatus();
            buildStatus.setBuildNumber(String.valueOf(buildStatusentry.getKey()));
            buildStatus.setBuildWithStatus(String.valueOf(buildStatusentry.getValue()));
            BuildStatusDetails.add(buildStatus);
        });
        return BuildStatusDetails;
    }
    
    @Override
    public List<String> extractFolderNames(String path) {
        AmazonS3Client s3Client = new AmazonS3Client().withRegion(S3_REGION_DEV_STG_DEVINT);

        return folderExtraction(TFConstants.BASE_S3_BUCKET_NAME.getValue(), s3Client, path);
    }
    
    private List<String> folderExtraction(String bucketName, AmazonS3 s3client, String prefixToBeFiltered) {
        String prefix = prefixToBeFiltered;
        String delimiter = "/";
        if (!prefix.endsWith(delimiter)) {
            prefix += delimiter;
        }

        ListObjectsRequest listObjectsRequest = new ListObjectsRequest().withBucketName(bucketName).withPrefix(prefix).withDelimiter(delimiter);
        ObjectListing objects = s3client.listObjects(listObjectsRequest);
        List<String> folderNames = Lists.newArrayList();
        objects.getCommonPrefixes().stream().forEach(action -> {
            String value = action.replaceFirst(Pattern.quote(prefixToBeFiltered), "").replace("/", "");
            folderNames.add(value);
        });
        return folderNames;
    }

    @Override
    public List<String> extractRdsSnapshots(String dbInstanceIdentifier) {
        AmazonRDSClient rds;
        if (dbInstanceIdentifier.contains("devint")) {
            rds = new AmazonRDSClient().withRegion(RDS_DEVINT_REGION);
        } else {
            rds = new AmazonRDSClient().withRegion(RDS_DEV_STG_REGION);
        }
        DescribeDBSnapshotsResult describeDBSnapshotsResult = rds
                .describeDBSnapshots(new DescribeDBSnapshotsRequest().withDBInstanceIdentifier(dbInstanceIdentifier));
        List<String> rdsSnapshots = Lists.newArrayList();
        describeDBSnapshotsResult.getDBSnapshots().stream().forEach(action -> {
            rdsSnapshots.add(action.getDBSnapshotIdentifier());
        });
        return rdsSnapshots;
    }
    /**
     * This method is used to trigger lambda function.
     * @param mapOfBuild has base path till build number as value, so that it gets the status of that build.  
     * @return map with build number and its appropriate status.
     */
    private static Map<String, String> getBuildStatus(Map<String, String> mapOfBuild) {
        Map<String, Map<String, String>> mapbuilder = Maps.newHashMap();
        mapbuilder.put(TFConstants.BUILD_STATUS.getValue(), mapOfBuild);
        InvokeRequest invokeRequest = new InvokeRequest().withFunctionName(TFConstants.LAMBDA_FUNCTION_NAME.getValue())
                .withPayload(String.valueOf(new Gson().toJson(mapbuilder)));
        AWSLambda awsLambda = AWSLambdaClientBuilder.standard().withRegion(TFW_BUILDSTATUS_LAMBDA_REGION).build();

        InvokeResult invokeResult = awsLambda.invoke(invokeRequest);
        ByteBuffer byteBuffer = invokeResult.getPayload();
        Map<String, String> buildStatus = Maps.newHashMap();
        try {

            String rawJson = new String(byteBuffer.array(), StandardCharsets.UTF_8.name());
            ObjectMapper mapper = new ObjectMapper();
            buildStatus = mapper.readValue(rawJson, Map.class);
        } catch (IOException e) {
            LOGGER.info("Exception Obtained when trying to extract response", e);
        }
        return buildStatus;
    }
    
    /**
     * This method is used to load the property file.
     * @return loaded property.
     */
    private static Properties loadProperties() {
        Properties prop = new Properties();
        try {
            File file = ResourceUtils.getFile(PROPERTY_FILE_NAME);
            if (file.exists()) {
                try (InputStream input = new FileInputStream(file)) {
                    // load a properties file
                    prop.load(input);
                } catch (IOException ex) {
                    LOGGER.info("Exception when trying to load Properties {}", ex);
                }
            }
        } catch (FileNotFoundException e) {
            LOGGER.info("exception occured when loading properties {}", e);
        }
        return prop;
    }


 @Override
    public StackDetails createMasterTestEngineStack(@NonNull final StackManagerCreateMasterRequest createMasterRequest, final String stackDetailsForELB) throws AwsClientException {
        String stackName = createMasterRequest.getStackName();

        StackDetails stackDetails;
        CreateStackRequest createRequest;

        createRequest = new CreateStackRequest()
                .withStackName(stackName)
                .withTemplateURL(createMasterRequest.getTemplateURL())
                .withParameters(
                        new Parameter().withParameterKey(CFParameters.CONFIG_SVC_URL.string()).withParameterValue(createMasterRequest.getConfigSvcURL()),
                        new Parameter().withParameterKey(CFParameters.CONFIG_SVC_PASS.string()).withParameterValue(createMasterRequest.getConfigSvcPass()),
                        new Parameter().withParameterKey(CFParameters.GHX_ENVIRONMENT.string()).withParameterValue(createMasterRequest.getEnvironment()),
                        new Parameter().withParameterKey(CFParameters.INSTANCE_TYPE.string()).withParameterValue(createMasterRequest.getInstanceType()),
                        new Parameter().withParameterKey(CFParameters.KEY_NAME.string()).withParameterValue(createMasterRequest.getKeyName()),
                        new Parameter().withParameterKey(CFParameters.VPC_STACK_NAME.string()).withParameterValue(createMasterRequest.getVpcStackName()),
                        new Parameter().withParameterKey(CFParameters.ADDITIONAL_JAVA_OPTS.string())
                                .withParameterValue(createMasterRequest.getAdditionalJavaOpts()),
                        new Parameter().withParameterKey(CFParameters.APPLICATION.string()).withParameterValue(createMasterRequest.getApplication()),
                        new Parameter().withParameterKey(CFParameters.APPLICATION_VERSION.string()).withParameterValue(createMasterRequest.getApplicationVersion()),
                        new Parameter().withParameterKey(CFParameters.BRANCH_NAME.string()).withParameterValue(createMasterRequest.getBranchName()),
                        new Parameter().withParameterKey(CFParameters.BUILD_NUMBER.string()).withParameterValue(createMasterRequest.getBuildNumber()),
                        new Parameter().withParameterKey(CFParameters.WAR.string()).withParameterValue(createMasterRequest.getWarFileName()),
                        new Parameter().withParameterKey(CFParameters.TAG_NAME.string()).withParameterValue(stackName),
                        new Parameter().withParameterKey(CFParameters.ELB_STACKNAME.string()).withParameterValue(stackDetailsForELB))
                        
                .withTags(
                        new Tag().withKey(CFTags.NAME.string()).withValue(stackName),
                        new Tag().withKey(CFTags.OWNER.string()).withValue(createMasterRequest.getOwnerTag()),
                        new Tag().withKey(CFTags.SERVICE.string()).withValue(createMasterRequest.getService()),
                        new Tag().withKey(CFTags.UPTIME_HOURS.string()).withValue(CFTags.UPTIME_HOURS.getDefaultValue()));

        LOGGER.info("Creating a stack called {}....", createRequest.getStackName());
        String createdStackId = cloudFormationService.createStack(createRequest);

        StackStatus stackStatus = blockingPollForCfStackStatus(cloudFormationService, stackName);
        if (StackStatus.CREATE_COMPLETE != stackStatus) {
            final String errStr = String.format("GRU stack \"%s\" was created with status %s instead of %s",
                    stackName, stackStatus, StackStatus.CREATE_COMPLETE.name());
            LOGGER.warn(errStr);
            throw new AwsClientException(errStr);
        }

        stackDetails = describingStackResourcesService.getAndPrintStackResourceInformation(createdStackId);

        return stackDetails;
    }



        StackDetails stackDetails;
        try {
            CreateStackRequest createUiElbRequest = new CreateStackRequest()
                    .withStackName(stackName)
                    .withTemplateURL(createHeimdallElbRequest.getTemplateURL())
                    .withParameters(
                            new Parameter().withParameterKey(CFParameters.VPC_STACK_NAME.string()).withParameterValue(createHeimdallElbRequest.getVpcStackName()),
                            new Parameter().withParameterKey(CFParameters.CONNECTION_DRAINING_TIMEOUT.string()).withParameterValue(createHeimdallElbRequest.getConnectionDrainingTimeout()),
                            new Parameter().withParameterKey(CFParameters.CONNECTION_IDLE_TIMEOUT.string()).withParameterValue(createHeimdallElbRequest.getConnectionIdleTimeout()),
                            new Parameter().withParameterKey(CFParameters.SERVICE.string()).withParameterValue(createHeimdallElbRequest.getService()))
                    .withTags(
                            new Tag().withKey(CFTags.NAME.string()).withValue(stackName),
                            new Tag().withKey(CFTags.OWNER.string()).withValue(createHeimdallElbRequest.getOwnerTag()),
                            new Tag().withKey(CFTags.SERVICE.string()).withValue(createHeimdallElbRequest.getService()));

            stackDetails = createStack(stackName, createUiElbRequest);
        } catch (AwsClientException ex) {
            LOGGER.error("Create CF Stack for Heimdall ELB failed", ex);
            throw new AwsClientException(ex);
        }
        return stackDetails;
    }


public void autoscaleAwsEngine(Map<String, String> desiredCapacity) {
String desiredPECapacity = desiredCapacity.get(TFConstants.PROCESSING.getValue());
String desiredIOCapacity = desiredCapacity.get(TFConstants.IO.getValue());
String desiredDPCapacity = desiredCapacity.get(TFConstants.DP.getValue());
String desiredJOBSCapacity = desiredCapacity.get(TFConstants.JOBS.getValue());

AmazonAutoScalingClient autoScalingClient = new AmazonAutoScalingClient().withRegion(Regions.US_WEST_2);
String nextToken = null;
DescribeAutoScalingGroupsResult describeResult;

String corexIOELB = buildCorexEngineELBName(TFConstants.IO.getValue());
String corexPROCESSINGELB = buildCorexEngineELBName(TFConstants.PROCESSING.getValue());
String corexDPELB = buildCorexEngineELBName(TFConstants.DP.getValue());
String corexJOBSELB = buildCorexEngineELBName(TFConstants.JOBS.getValue());

DescribeAutoScalingGroupsRequest describeAutoScalingGroupRequest = new DescribeAutoScalingGroupsRequest();
UpdateAutoScalingGroupRequest updateAutoScalinggrouprequest = new UpdateAutoScalingGroupRequest();
do {
describeResult = autoScalingClient
.describeAutoScalingGroups(describeAutoScalingGroupRequest.withNextToken(nextToken));
for (AutoScalingGroup autoscalingGroup : describeResult.getAutoScalingGroups()) {
if (autoscalingGroup.getLoadBalancerNames().contains(corexIOELB)
&& autoscalingGroup.getDesiredCapacity() != 0) {
LOGGER.debug("Autoscaling IO Engine with {}", desiredIOCapacity);
UpdateAutoScalingGroupRequest updatereq = updateAutoScalinggrouprequest
.withAutoScalingGroupName(autoscalingGroup.getAutoScalingGroupName());
updatereq.setMaxSize(Integer.parseInt(desiredIOCapacity));
updatereq.setDesiredCapacity(Integer.parseInt(desiredIOCapacity));
autoScalingClient.updateAutoScalingGroup(updatereq);
LOGGER.debug("Autoscaled IO Engine with {}", desiredIOCapacity);
}
if (autoscalingGroup.getLoadBalancerNames().contains(corexPROCESSINGELB)
&& autoscalingGroup.getDesiredCapacity() != 0) {
LOGGER.debug("Autoscaling Processing Engine with {}", desiredPECapacity);
UpdateAutoScalingGroupRequest updatereq = updateAutoScalinggrouprequest
.withAutoScalingGroupName(autoscalingGroup.getAutoScalingGroupName());
updatereq.setMaxSize(Integer.parseInt(desiredPECapacity));
updatereq.setDesiredCapacity(Integer.parseInt(desiredPECapacity));
autoScalingClient.updateAutoScalingGroup(updatereq);
LOGGER.debug("Autoscaled Processing Engine with {}", desiredPECapacity);
}

if (autoscalingGroup.getLoadBalancerNames().contains(corexDPELB)
&& autoscalingGroup.getDesiredCapacity() != 0) {
LOGGER.debug("Autoscaling DP with {}", desiredDPCapacity);
UpdateAutoScalingGroupRequest updatereq = updateAutoScalinggrouprequest
.withAutoScalingGroupName(autoscalingGroup.getAutoScalingGroupName());
updatereq.setMaxSize(Integer.parseInt(desiredDPCapacity));
updatereq.setDesiredCapacity(Integer.parseInt(desiredDPCapacity));
autoScalingClient.updateAutoScalingGroup(updatereq);
LOGGER.debug("Autoscaled DP with {}", desiredDPCapacity);
}

if (autoscalingGroup.getLoadBalancerNames().contains(corexJOBSELB)
&& autoscalingGroup.getDesiredCapacity() != 0) {
LOGGER.debug("Autoscaling Job Engine with {}", desiredJOBSCapacity);
UpdateAutoScalingGroupRequest updatereq = updateAutoScalinggrouprequest
.withAutoScalingGroupName(autoscalingGroup.getAutoScalingGroupName());
updatereq.setMaxSize(Integer.parseInt(desiredJOBSCapacity));
updatereq.setDesiredCapacity(Integer.parseInt(desiredJOBSCapacity));
autoScalingClient.updateAutoScalingGroup(updatereq);
LOGGER.debug("Autoscaled Job Engine with {}", desiredJOBSCapacity);
}
}
nextToken = describeResult.getNextToken();
} while (nextToken != null);
}

private String buildCorexEngineELBName(String engineELB) {
return TFConstants.COREX.getValue() + TFConstants.HYPHEN.getValue() + EC2Utils.determineEnvironmentType()
+ TFConstants.HYPHEN.getValue() + engineELB + TFConstants.HYPHEN.getValue()
+ TFConstants.ELB.getValue();
}

>>>>>>>>>>>

curl -v https://workflow.ghx.com/rest/api/2/search?jql=key = EGXC-36165 --user spkannan@ghx.com:5rq3Gmwq1TidbCq4pB1l94EF

curl -v https://workflow.ghx.com/rest/api/2/search?jql=key = EGXC-36165 -H "Authorization: Basic 5rq3Gmwq1TidbCq4pB1l94EF"

curl -X GET -H "Authorization: Basic base64(spkannan@ghx.com:5rq3Gmwq1TidbCq4pB1l94EF)" -H "Content-Type: application/json" "https://workflow.ghx.com/rest/api/2/search?jql=key = EGXC-36165"

curl -H "Authorization: Bearer 5rq3Gmwq1TidbCq4pB1l94EF" https://workflow.ghx.com/rest/api/2/search?jql=key = EGXC-36165

curl -X GET https://workflow.ghx.com/jira/rest/auth/1/session -H 'content-type: application/json'

Atlassian account

https://id.atlassian.com


Manage API tokens for your Atlassian account | Atlassian Support

https://support.atlassian.com

Type a message

1. ui-hemidal execute the below comment
chmod -R 777 /var/lib/tomcat/webapps/ROOT/WEB-INF/lib

2. build local testframework api jar
3. connect to filezilla ..select target folder
source folder : /home/sys-user/project/corex-coe/git-small/all/test-framework/test-framework-api/target
destination folder: /var/lib/tomcat/webapps/ROOT/WEB-INF/lib

4. systemctl stop tomcat

5. In Filexilla move testframework api jar from source folder to destination folder

6. systemctl start tomcat

    public static List<JiraIssueDetail> fetchJiraId(String issueKey) throws TestFWServerException {
        List<JiraIssueDetail> jiraIssues = Lists.newArrayList();

        String startURL = new StringBuilder().append("https://")
                .append("workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query=")
                .append(issueKey).toString();
        try {
            RestTemplate restTemplate = new RestTemplate();
            ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET, new HttpEntity(createHeaders("bamboouser", "P@nd@F00d")),
                    String.class);
            String body = output.getBody().toString();
            JSONObject responseJson = new JSONObject(body);
            System.out.println(">>>>>>>>>>>>>>>>>>1stbody"+responseJson);
            JSONArray jsonArray = new JSONArray(responseJson.get("sections").toString());
            JSONObject section = jsonArray.getJSONObject(0);
            JSONArray issues = new JSONArray(section.get("issues").toString());
            for (int i = 0; i < issues.length(); i++) {
                JSONObject issue = issues.getJSONObject(i);
                JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
                jiraIssueDetail.setKey(issue.get("key").toString());
                jiraIssueDetail.setSummary(issue.get("summary").toString());
                jiraIssues.add(jiraIssueDetail);
            }
            System.out.println(">>>>>>>>>>>>>>>>>1"+jiraIssues);

        } catch (Exception e) {
            LOGGER.error("Error getting jira id", e);
        }


        if (jiraIssues.size() == 0) {
            try {
                startURL = new StringBuilder().append("https://").append("workflow.ghx.com/rest/api/2/search?jql=key =")
                        .append(issueKey.toUpperCase(Locale.US)).toString();
                RestTemplate restTemplate = new RestTemplate();
                /*
                 * SimpleClientHttpRequestFactory clientHttpRequestFactory = new SimpleClientHttpRequestFactory();
                 * // Connect timeout: time is in milliseconds
                 * clientHttpRequestFactory.setConnectTimeout(3000);
                 * // Read timeout: time is in milliseconds
                 * clientHttpRequestFactory.setReadTimeout(3000);
                 * RestTemplate restTemplate = new RestTemplate();
                 * HttpHeaders headers = new HttpHeaders();
                 * headers.setAccept(Arrays.asList(MediaType.APPLICATION_JSON));
                 * headers.add("user-agent",
                 * "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.99 Safari/537.36");
                 * HttpEntity<String> entity = new HttpEntity<String>("parameters", headers);
                 */

                ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET,new HttpEntity(createHeaders("bamboouser", "P@nd@F00d")),String.class);

                /*
                 * System.out.println(response);
                 * ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET,
                 * new HttpEntity(createHeaders("spkannan", "5rq3Gmwq1TidbCq4pB1l94EF")), String.class);
                 */              System.out.println(">>>>>>>>>>>>>>>>>>>>>>>2"+output);
                String body = output.getBody().toString();
                JSONObject responseJson = new JSONObject(body);
                JSONArray issues = new JSONArray(responseJson.get("issues").toString());
                for (int i = 0; i < issues.length(); i++) {
                    JSONObject issue = issues.getJSONObject(i);
                    JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
                    jiraIssueDetail.setKey(issue.get("key").toString());
                    JSONObject fields = issue.getJSONObject("fields");
                    jiraIssueDetail.setSummary(fields.get("summary").toString());
                    jiraIssues.add(jiraIssueDetail);
                }
                System.out.println(">>>>>>>>>>>>>>>>>>>>>>>3"+jiraIssues);
            } catch (RestClientException | JSONException e) {
                LOGGER.error("Error getting jira id", e);
                throw new TestFWServerException("The issue key " + issueKey + " does not exist.");
            }
        }
        System.out.println(">>>>>>>>>>>>>>>>>4"+jiraIssues);

        return jiraIssues;
    }

    public static void main(String[] args) {
        
          //testClient("old");
        /*
         * try {
         * fetchJiraId("CXTF-24");
         * } catch (TestFWServerException e) {
         * // TODO Auto-generated catch block
         * e.printStackTrace();
         * System.out.println(e.toString());
         * }
         */
        List<JiraIssueDetail> jiraIssues = Lists.newArrayList();

        String startURL = new StringBuilder().append("https://")
                .append("https://workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query=CXTF-")
                .append("").toString();
        try {
            SimpleClientHttpRequestFactory clientHttpRequestFactory = new SimpleClientHttpRequestFactory();
            clientHttpRequestFactory.setConnectTimeout(3000);
            clientHttpRequestFactory.setReadTimeout(3000);
            RestTemplate restTemplate = new RestTemplate(clientHttpRequestFactory);
            ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET, new HttpEntity(createHeaders("bamboouser", "P@nd@F00d")),
                    String.class);
            String body = output.getBody().toString();
            JSONObject responseJson = new JSONObject(body);
            System.out.println(">>>>>>>>>>>>>>>>>>1stbody"+responseJson);
            JSONArray jsonArray = new JSONArray(responseJson.get("sections").toString());
            JSONObject section = jsonArray.getJSONObject(0);
            JSONArray issues = new JSONArray(section.get("issues").toString());
            for (int i = 0; i < issues.length(); i++) {
                JSONObject issue = issues.getJSONObject(i);
                JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
                jiraIssueDetail.setKey(issue.get("key").toString());
                jiraIssueDetail.setSummary(issue.get("summary").toString());
                jiraIssues.add(jiraIssueDetail);
            }
            System.out.println(">>>>>>>>>>>>>>>>>1"+jiraIssues);

        } catch (Exception e) {
            LOGGER.error("Error getting jira id", e);
        }
        
        /*
         * HttpHeaders httpHeaders = new HttpHeaders();
         * try {
         * String startURL = "https://workflow.ghx.com/rest/api/2/search?jql=";
         * RestTemplate restTemplate = SecurityUtil.getRestTemplate();
         * String auth = "bamboouser" + ":" + "P@nd@F00d";
         * byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.US_ASCII));
         * String authHeader = "Basic " + new String(encodedAuth);
         * httpHeaders.add("Authorization", authHeader);
         * ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET,
         * new HttpEntity(httpHeaders),
         * String.class);
         * String body = output.getBody().toString();
         * JSONObject responseJson = new JSONObject(body);
         * System.out.println(responseJson);
         * JSONArray issues = new JSONArray(responseJson.get("issues").toString());
         * System.out.println(issues);
         * for (int i = 0; i < issues.length(); i++) {
         * JSONObject issue = issues.getJSONObject(i);
         * JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
         * jiraIssueDetail.setKey(issue.get("key").toString());
         * JSONObject fields = issue.getJSONObject("fields");
         * jiraIssueDetail.setSummary(fields.get("summary").toString());
         * System.out.println(jiraIssueDetail);
         * //jiraIssues.add(jiraIssueDetail);
         * }
         * } catch (Exception e) {
         * LOGGER.error("Error getting jira id", e);
         * // throw new TestFWServerException("The issue key does not exist.");
         * }
         */
    }

    // public static void main(String[] args) {
    /*
     * AtlassianOAuthClient jiraoAuthClient = getJiraOAuthClient();
     * TokenSecretVerifierHolder requestToken = jiraoAuthClient.getRequestToken();
     * String authorizeUrl = jiraoAuthClient.getAuthorizeUrlForToken(requestToken.token);
     * String token = requestToken.token;
     * String tokenSecret = requestToken.secret;
     * System.out.println("Token is " + requestToken.token);
     * System.out.println("Token secret is " + requestToken.secret);
     * System.out.println("Retrieved request token. go to " + authorizeUrl)
     * //createHeaders();
     * // AtlassianHostRestClients atlassianHostRestClients = new AtlassianHostRestClients();
     * HttpServletRequest request;
     * HttpSession session = request.getSession(true);
     * String username = (String)session.getAttribute("username");
     * System.out.println("username"+username);
     */
    
    /*
     * HttpHeaders httpHeaders = new HttpHeaders();
     * try {
     * String startURL = "https://workflow.ghx.com/rest/api/2/search?jql=";
     * RestTemplate restTemplate = SecurityUtil.getRestTemplate();
     * String auth = "bamboouser" + ":" + "P@nd@F00d";
     * byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.US_ASCII));
     * String authHeader = "Basic " + new String(encodedAuth);
     * httpHeaders.add("Authorization", authHeader);
     * ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET,
     * new HttpEntity(httpHeaders),
     * String.class);
     * String body = output.getBody().toString();
     * JSONObject responseJson = new JSONObject(body);
     * System.out.println(responseJson);
     * JSONArray issues = new JSONArray(responseJson.get("issues").toString());
     * System.out.println(issues);
     * for (int i = 0; i < issues.length(); i++) {
     * JSONObject issue = issues.getJSONObject(i);
     * JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
     * jiraIssueDetail.setKey(issue.get("key").toString());
     * JSONObject fields = issue.getJSONObject("fields");
     * jiraIssueDetail.setSummary(fields.get("summary").toString());
     * System.out.println(jiraIssueDetail);
     * //jiraIssues.add(jiraIssueDetail);
     * } catch (Exception e) {
     * LOGGER.error("Error getting jira id", e);
     * // throw new TestFWServerException("The issue key does not exist.");
     * }
     */
     


    /*
     * final String startURL = "https://workflow.ghx.com/rest/api/2/search?jql=key=EGXC-36165";
     * String auth = "spkannan" + ":" + "Njg3OTIyNTE5MjE5OlNoBJen7JdO1jLtWP0j8onj1KQs";
     * byte[] baseenc = Base64.encodeBase64(auth.getBytes(StandardCharsets.US_ASCII));;
     * String headerAuthorization = "Authorization";
     * String headerAuthorizationValue = "Basic " + baseenc;
     * String headerType = "application/json";
     * HttpHeaders httpHeaders = new HttpHeaders();
     * // String auth = "bamboouser" + ":" + "P@nd@F00d";
     * String auth = "spkannan@ghx.com:Corex@tfw123";
     * byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.US_ASCII));
     * httpHeaders.set(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE);
     * httpHeaders.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
     * String authHeader = "Basic " + new String(encodedAuth);
     * httpHeaders.add("Authorization", authHeader);
     * RestTemplate restTemplate = SecurityUtil.getRestTemplate();
     * ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET,
     * new HttpEntity(httpHeaders),
     * String.class);
     * String body = output.getBody().toString();
     * System.out.println(body);
     * }
     */
    public static void testClient(String userId) {
        final String URL_PROPERTIES = new StringBuilder().append("https://").append("workflow.ghx.com/rest/api/2/search?jql=key =")
                .append("CXTF-2433").toString();

     // HttpHeaders
     HttpHeaders headers = new HttpHeaders();

     headers.setAccept(Arrays.asList(new MediaType[] { MediaType.APPLICATION_XML }));
     // Request to return XML format
     headers.setContentType(MediaType.APPLICATION_XML);
     // headers.set("my_other_key", "my_other_value");

     // HttpEntity: To get result as Employee[].
     String auth = "bamboouser" + ":" + "P@nd@F00d";
     byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.US_ASCII));
     String authHeader = "Basic " + new String(encodedAuth);
     headers.add("Authorization", authHeader);
     HttpEntity entity = new HttpEntity(headers);

     // RestTemplate
     RestTemplate restTemplate = new RestTemplate();

     // Send request with GET method, and Headers.
     ResponseEntity<String> response = restTemplate.exchange(URL_PROPERTIES, HttpMethod.GET, entity, String.class);

     HttpStatus statusCode = response.getStatusCode();
     System.out.println("Response Satus Code: " + statusCode);

     // Status Code: 200
     if (statusCode == HttpStatus.OK) {
     // Response Body Data
     //String list = response.getBody();

     response.getBody().toString();
     }
    }


  /*
     * public static HttpHeaders createHeaders() {
     * HttpResponse<JsonNode> response = Unirest.get("/rest/api/3/application-properties")
     * .basicAuth("email@example.com", "<api_token>")
     * .header("Accept", "application/json")
     * .asJson();
     * // System.out.println(response.getBody());
     * // AtlassianHostRestClients atlassianHostRestClients = new AtlassianHostRestClients();
     * String startURL = new StringBuilder().append(HTTPS_PROTOCOL).append(TFConfigKeys.TFW_WORKFLOW_HOSTNAME.getValue())
     * .append(TFConfigKeys.TFW_WORKFLOW_ISSUE_PICKER_URL.getValue()).append("CXTF-").toString();
     * Object s =atlassianHostRestClients.authenticatedAsAddon().getForObject(startURL, Void.class);
     * System.out.println(s);
     * HttpHeaders httpHeaders = new HttpHeaders();
     * String auth = username + ":" + password;
     * byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.US_ASCII));
     * String authHeader = "Basic " + new String(encodedAuth);
     * httpHeaders.add("Authorization", authHeader);
     * return httpHeaders;
     * Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
     * CustomAuthenticationToken auth = (CustomAuthenticationToken) authentication;
     * System.out.println("pppppppwd:>>>>>>>>>>>>>>>>>>>" + ((User) auth.getPrincipal()));
     * System.out.println("pp111ppwd:>>>>>>>>>>>>>>>>>>>" + DAOUtil.getContext().getActualUser());
     * System.out.println("pp222ppwd:>>>>>>>>>>>>>>>>>>>" + DAOUtil.getContext().getActingUser());
     * System.out.println("pppppppwd:>>>>>>>>>>>>>>>>>>>" + ((User) auth.getPrincipal()).getPassword());
     * System.out.println("pp111ppwd:>>>>>>>>>>>>>>>>>>>" + DAOUtil.getContext().getActualUser().getPassword());
     * System.out.println("pp222ppwd:>>>>>>>>>>>>>>>>>>>" + DAOUtil.getContext().getActingUser().getPassword());
     * System.out.println("username:>>>>>>>>>>>>>>>>>>>" + DAOUtil.getUserName().toString());
     * System.out.println("auth.getAccessTokenValue():" + auth.getAccessTokenValue());
     * String username = DAOUtil.getUserName().toString();
     * System.out.println("password:>>>>>>>>>>>>>>>>>>>" + auth.getCredentials());
     * String password = (String) auth.getCredentials();
     * System.out.println("username:>>>>>>>>>>>>>>>>>>>" + username);
     * System.out.println("password:>>>>>>>>>>>>>>>>>>>" + password);
     * // if (authentication instanceof CustomAuthenticationToken) {
     * // CustomAuthenticationToken auth = (CustomAuthenticationToken) authentication;
     * System.out.println("auth:" + auth);
     * System.out.println("auth.getAccessTokenValue()" + auth.getAccessTokenValue());
     * httpHeaders.set(HttpHeaders.ACCEPT, MediaType.APPLICATION_JSON_VALUE);
     * httpHeaders.set(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_JSON_VALUE);
     * httpHeaders.set(SecurityConstants.AUTHORIZATION, String.format(SecurityConstants.BASIC_ + "%s", auth.getAccessTokenValue()));
     * String auth = username + ":" + password;
     * byte[] encodedAuth = Base64.encodeBase64(auth.getBytes(StandardCharsets.US_ASCII));
     * String authHeader = "Basic " + new String(encodedAuth);
     * httpHeaders.add("Authorization", authHeader);
     * // }
     * return httpHeaders;
     * }
     */

    /*
     * public static void main(String[] args) {
     * String pwd = "bamboouser";
     * String enc = EncryptionUtils.encrypt(pwd);
     * System.out.println(enc);
     * String dec = EncryptionUtils.decrypt(enc);
     * System.out.println(dec);
     * List<JiraIssueDetail> jiraIssues = Lists.newArrayList();
     * String startURL = new StringBuilder().
     * append("https://workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query=CXTF-"
     * ).append("").toString();
     * try {
     * RestTemplate restTemplate = SecurityUtil.getRestTemplate();
     * // System.out.println("cred to string:"+SecurityContextHolder.getContext().getAuthentication().getCredentials().toString());
     * ResponseEntity<String> output = restTemplate.exchange(startURL, HttpMethod.GET, new HttpEntity(createHeaders("bamboouser", "P@nd@F00d")),
     * String.class);
     * String body = output.getBody().toString();
     * JSONObject responseJson = new JSONObject(body);
     * JSONArray jsonArray = new JSONArray(responseJson.get("sections").toString());
     * JSONObject section = jsonArray.getJSONObject(0);
     * JSONArray issues = new JSONArray(section.get("issues").toString());
     * for (int i = 0; i < issues.length(); i++) {
     * JSONObject issue = issues.getJSONObject(i);
     * JiraIssueDetail jiraIssueDetail = new JiraIssueDetail();
     * jiraIssueDetail.setKey(issue.get("key").toString());
     * jiraIssueDetail.setSummary(issue.get("summary").toString());
     * jiraIssues.add(jiraIssueDetail);
     * }
     * } catch (RestClientException | JSONException e) {
     * LOGGER.error("Error getting jira id", e);
     * }
     * }
     */



curl --request GET --url 'https://workflow.ghx.com/rest/api/2/issue/picker?query=CXTF-' --user 'spkannan@ghx.com:5rq3Gmwq1TidbCq4pB1l94EF' --header 'Accept: application/json'






User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:74.0) Gecko/20100101 Firefox/74.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Connection: keep-alive
Cookie: _ga=GA1.2.45337172.1581426392; _gid=GA1.2.1686475448.1636487496; JSESSIONID=5C4087637729BF8FB5A17D8D9CEA7969; atlassian.xsrf.token=BFGY-WPR6-Z5R1-0R4V_34a98808f6a4cc1b7ad362d47a04db789a8c1232_lin; AWSELB=09AB99B518AFEB6417102EE9CCFEAC91B063128D69963AC8E5878ABB2EE207E06093B093F5D5B463F35849532204D8A2C1933CB6CF9555CF1DAF59735A77174332DAA3D48650F2207C6332A0DA447277FD22902A37; session-data-f0da0d33-fcda-408d-8479-dd344870ecac=; _gat_gtag_UA_61004204_10=1; seraph.rememberme.cookie=189759%3Ac9a15ceaa4e1e6b1bf65d72162af2c83afdf9344
Upgrade-Insecure-Requests: 1
Cache-Control: max-age=0


 @Annamalai rams_pwd1@ghx.com/SMI@2021 - User credential

maheshsmi.077@gmail.com/user^123 - DEV CredentialType a message


Type a message


  /*
         * UsernamePasswordAuthenticationToken auth = new UsernamePasswordAuthenticationToken("bamboouser", "P@nd@F00d");
         * //auth.setAuthenticated(true);
         * SecurityContextHolder.getContext().setAuthentication(auth);
         * List<JiraIssueDetail> jiraIssues = Lists.newArrayList();
         */
        //String okta = "https://ghxsso.okta.com/app/ghx_jiraworkflow_1/exk1d8wjb36PnD7Gd357/sso/saml?SAMLRequest=fVJdb4IwFP0rpO9QijChERM3N2filCjbw15MhaootKy3qD9/lWnmHmZyX%2B7HOTnn5PaAVWVNB43eijn/ajho61SVAmi7iFGjBJUMCqCCVRyozuhi8DahnuPSWkktM1miG8h9BAPgShdSIGs8jNFs%2BjyZjcbTZeZ3PW/t5nYe5pHth35mh2u/Y5MoJG7QjfwoCpD1wRUYbIwMlSEAaPhYgGZCm5HrEZuYclM3oCSgHvlE1otUGW/NxUirhiNraBwWgumWZ6t1DRTjzfYEIB2518zJZIVZXZ9ny12h2FGq/bqUxyXB/LQneXjcrToPiRh2R3kn6GIDxGfjyEoucTwWIi/E5n4Sq58joK9pmtjJbJEia3BN50kKaCquFlwdioy/zye/Wq96HCOwFVuXzaYQgA32UHLdiskuBKjfO7e0zUr1/%2BPo4durn%2B7vU/S/AQ%3D%3D&RelayState=f0da0d33-fcda-408d-8479-dd344870ecac";

....>>>>






curl -X GET "https://search-test-framework-es2-rh4ypdodfobsgmd54nfsnphatm.us-west-2.es.amazonaws.com/stg-topbeat-2020.01.14?pretty"


{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::050190852521:role/lambda_elasticsearch_execution-flowlogs"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:us-west-2:050190852521:domain/test-framework-es2/*"
    },
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:us-west-2:050190852521:domain/test-framework-es2/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": [
            "52.13.163.43",
            "72.13.124.2",
            "72.13.124.3",
            "182.73.138.8",
            "182.73.138.7",
            "157.51.109.233"
          ]
        }
      }
    }
  ]
}

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::050190852521:role/lambda_elasticsearch_execution-flowlogs"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:us-west-2:050190852521:domain/test-framework-es7/*"
    },
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:us-west-2:050190852521:domain/test-framework-es7/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": [
            "52.13.163.43",
            "72.13.124.2",
            "72.13.124.3",
            "182.73.138.8",
            "182.73.138.7"
          ]
        }
      }
    }
  ]
}


{
  "dev-minion-jtl-logs-2020.01.14" : {
    "aliases" : {
      "dev-minion-jtl-logs_all" : { }
    },
    "mappings" : {
      "testresultsjtl" : {
        "properties" : {
          "@timestamp" : {
            "type" : "date",
            "format" : "strict_date_optional_time||epoch_millis"
          },
          "@version" : {
            "type" : "string"
          },
          "Connect" : {
            "type" : "long"
          },
          "IdleTime" : {
            "type" : "long"
          },
          "Latency" : {
            "type" : "long"
          },
          "allThreads" : {
            "type" : "long"
          },
          "application" : {
            "type" : "string"
          },
          "appversion" : {
            "type" : "string"
          },
          "buildnumber" : {
            "type" : "string"
          },
          "bytes" : {
            "type" : "long"
          },
          "cfstack" : {
            "type" : "string"
          },
          "elapsed" : {
            "type" : "long"
          },
          "ghxenvironment" : {
            "type" : "string"
          },
          "ghxhost" : {
            "type" : "string"
          },
          "grpThreads" : {
            "type" : "long"
          },
          "host" : {
            "type" : "string"
          },
          "instanceId" : {
            "type" : "string"
          },
          "label" : {
            "type" : "string"
          },
          "message" : {
            "type" : "string"
          },
          "path" : {
            "type" : "string"
          },
          "responseCode" : {
            "type" : "string"
          },
          "responseMessage" : {
            "type" : "string"
          },
          "sentBytes" : {
            "type" : "long"
          },
          "service" : {
            "type" : "string"
          },
          "success" : {
            "type" : "string"
          },
          "tags" : {
            "type" : "string"
          },
          "testResultId" : {
            "type" : "string"
          },
          "threadName" : {
            "type" : "string"
          },
          "timeStamp" : {
            "type" : "string"
          },
          "type" : {
            "type" : "string"
          }
        }
      }
    },
    "settings" : {
      "index" : {
        "max_result_window" : "500000",
        "creation_date" : "1579022949324",
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "OqxfjtQUSrqXfTEShSg4Ng",
        "version" : {
          "created" : "2030299"
        }
      }
    },
    "warmers" : { }
  }
}
......
>>>>>>



curl -X GET "https://search-test-framework-es2-rh4ypdodfobsgmd54nfsnphatm.us-west-2.es.amazonaws.com/stg-topbeat-2020.01.14?pretty"


{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::050190852521:role/lambda_elasticsearch_execution-flowlogs"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:us-west-2:050190852521:domain/test-framework-es2/*"
    },
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:us-west-2:050190852521:domain/test-framework-es2/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": [
            "52.13.163.43",
            "72.13.124.2",
            "72.13.124.3",
            "182.73.138.8",
            "182.73.138.7",
            "157.51.109.233"
          ]
        }
      }
    }
  ]
}

{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::050190852521:role/lambda_elasticsearch_execution-flowlogs"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:us-west-2:050190852521:domain/test-framework-es7/*"
    },
    {
      "Effect": "Allow",
      "Principal": {
        "AWS": "*"
      },
      "Action": "es:*",
      "Resource": "arn:aws:es:us-west-2:050190852521:domain/test-framework-es7/*",
      "Condition": {
        "IpAddress": {
          "aws:SourceIp": [
            "52.13.163.43",
            "72.13.124.2",
            "72.13.124.3",
            "182.73.138.8",
            "182.73.138.7"
          ]
        }
      }
    }
  ]
}


{
  "dev-minion-jtl-logs-2020.01.14" : {
    "aliases" : {
      "dev-minion-jtl-logs_all" : { }
    },
    "mappings" : {
      "testresultsjtl" : {
        "properties" : {
          "@timestamp" : {
            "type" : "date",
            "format" : "strict_date_optional_time||epoch_millis"
          },
          "@version" : {
            "type" : "string"
          },
          "Connect" : {
            "type" : "long"
          },
          "IdleTime" : {
            "type" : "long"
          },
          "Latency" : {
            "type" : "long"
          },
          "allThreads" : {
            "type" : "long"
          },
          "application" : {
            "type" : "string"
          },
          "appversion" : {
            "type" : "string"
          },
          "buildnumber" : {
            "type" : "string"
          },
          "bytes" : {
            "type" : "long"
          },
          "cfstack" : {
            "type" : "string"
          },
          "elapsed" : {
            "type" : "long"
          },
          "ghxenvironment" : {
            "type" : "string"
          },
          "ghxhost" : {
            "type" : "string"
          },
          "grpThreads" : {
            "type" : "long"
          },
          "host" : {
            "type" : "string"
          },
          "instanceId" : {
            "type" : "string"
          },
          "label" : {
            "type" : "string"
          },
          "message" : {
            "type" : "string"
          },
          "path" : {
            "type" : "string"
          },
          "responseCode" : {
            "type" : "string"
          },
          "responseMessage" : {
            "type" : "string"
          },
          "sentBytes" : {
            "type" : "long"
          },
          "service" : {
            "type" : "string"
          },
          "success" : {
            "type" : "string"
          },
          "tags" : {
            "type" : "string"
          },
          "testResultId" : {
            "type" : "string"
          },
          "threadName" : {
            "type" : "string"
          },
          "timeStamp" : {
            "type" : "string"
          },
          "type" : {
            "type" : "string"
          }
        }
      }
    },
    "settings" : {
      "index" : {
        "max_result_window" : "500000",
        "creation_date" : "1579022949324",
        "number_of_shards" : "5",
        "number_of_replicas" : "1",
        "uuid" : "OqxfjtQUSrqXfTEShSg4Ng",
        "version" : {
          "created" : "2030299"
        }
      }
    },
    "warmers" : { }
  }
}

>>>>>>>>>>


cloud mongo connection


#!/usr/bin/python
"""
collects cloud mongo event bus scan and order metric details and push to ES
"""
#import json
#import time
import logging
import requests
#import re
#from requests import get
from requests.auth import HTTPDigestAuth
from datetime import datetime, timedelta
#from elasticsearch import Elasticsearch, helpers

mms_public_key = 'cigztdwr'
mms_private_key = 'b68db372-6ff0-4e02-907a-534563785cde'

GHX_DEV = '5373a8689194bf134f7a93ad'

now = datetime.utcnow()
fromdate = (now - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:%S")\
            + "+00:00"
todate = now.strftime("%Y-%m-%dT%H:%M:%S") + "+00:00"
exec_starttime = datetime.utcnow()

'''configuration = {}
def load_config(configobj, cfile):
    """load configuration details"""
    f = open(cfile, 'r')
    for line in f:
        line = line.strip()
        (param, value) = re.split(':', line, maxsplit=1)
        configobj[param] = value
    f.close()
    return configobj

load_config(configuration, '/opt/conf/cf-params.txt')

def set_subdomain(metaobj):
    """set sub domain details"""
    if metaobj['accountId'] == "050190852521":
        subd = 'awsdsi.ghx.com'
    else:
        subd = 'awsprd.ghx.com'
    return subd

meta = json.loads(get('http://169.254.169.254/latest/dynamic/'\
                      +'instance-identity/document/').content)
instance_id = meta['instanceId']
hostname = meta['privateIp']

subdomain = set_subdomain(meta)

es = Elasticsearch(['http://' + meta['region'] + '-testframework-es.'\
                    + subdomain + ':80'])'''

def get_clusters(group_id):
    """ pulls data from mms api - by group"""
    r = requests.get('https://cloud.mongodb.com/api/public/v1.0/groups/'\
                     +group_id+'/clusters?',
                     headers={'Accept': 'application/json'},
                     auth=HTTPDigestAuth(mms_public_key, mms_private_key))
    r_json = r.json()
    return r_json['results']

def get_host_with_clusterid(group_id, cluster_id):
    r = requests.get('https://cloud.mongodb.com/api/public/v1.0/groups/'\
                     +group_id+'/hosts?clusterId='+cluster_id,
                     headers={'Accept': 'application/json'},
                     auth=HTTPDigestAuth(mms_public_key, mms_private_key))
    r_json = r.json()
    return r_json['results']

def get_with_meastype_granular_duration(href,granularity,starttime,endtime,
                                        measurementtype,hostname):   
    r = requests.get(href+'/measurements?granularity='+granularity+'&start='\
                         +starttime+'&end='+endtime+'&m='+measurementtype+\
                         '&processId='+hostname+'&pretty=true',
                         headers={'Accept': 'application/json'},
                         auth=HTTPDigestAuth(mms_public_key, mms_private_key))
    r_json = r.json()
    return r_json['measurements']

count = 0
total_exec_time = 0
#while True:
#try:
result_cluster_details = get_clusters(GHX_DEV)
#print("The result of Cluster is:%s",result_cluster_details)
clusterid=[]
hostnameandhref={}

hostname_with_value_scan_and_order={}
hostname_with_opcount_query={}

cloudmongoscanandorders = []
cloudmongoopcounterqueries = []
logging.info(count)
for id, element in enumerate(result_cluster_details):
   if element["clusterName"] == "event-bus-stg-sharded-cluster"\
   and element["typeName"] == "REPLICA_SET" :
#        print("NNNNN",element["id"])
       clusterid.append(element["id"])
#print("The cluster id is :%s",clusterid)
for clus_id in clusterid:
#    print("the cluster id",clus_id)
        result_host_details = get_host_with_clusterid(GHX_DEV, clus_id)
#    print("The result of host is:%s",result_host_details)
        for element in result_host_details:
#        print("The hostname is :%s and url is:%s",element["hostname"], element["links"])
#        print("The hostName is:%s",element["hostname"])
            r = element["hostname"]
            hostnameandhref[r] = element["links"]  
            for ref in element["links"]:
#            print("The href is :%s",ref["href"])
                hostnameandhref[r] = ref["href"]
                #print(hostnameandhref)
for key in hostnameandhref:
    scan_order = get_with_meastype_granular_duration(
            hostnameandhref[key],"PT10S",\
            "2020-05-22T08:38:15Z",\
            "2020-05-22T08:39:15Z",\
            "OPERATIONS_SCAN_AND_ORDER",key)
                #print(">>>>>>>>>>>>scan_order")
    for datapoint in scan_order:
                        #print(">>>>>>>>>>>>scan_order:%s",datapoint["dataPoints"])
        for timevalue in datapoint["dataPoints"]:
            #print("scanandorder: key%s time%s value%s",key,timevalue["timestamp"],timevalue["value"]) 
               
            cloudmongoscanandorder = {"granularity": 'PT10S',
                                        "hostname": key,
                                        "clusterName":"event-bus-stg-sharded-cluster",
                                        "measurement_type":"OPERATIONS_SCAN_AND_ORDER",
                                        "value": timevalue["value"],
                                        "@timestamp": timevalue["timestamp"]}
            #logging.info(cloudmongoscanandorder)
            print cloudmongoscanandorder
    opcounter = get_with_meastype_granular_duration(
            hostnameandhref[key],"PT10S",\
                    "2020-05-22T08:38:15Z",\
                    "2020-05-22T08:39:15Z",\
                    "OPCOUNTER_QUERY",key)
                    #print(">>>>>>>>>>>>opcounter")
    for datapoint in opcounter:
                        #print(">>>>>>>>>>>>opcounter:%s",datapoint["dataPoints"])
        for timevalue in datapoint["dataPoints"]:
                            #print timevalue 
            #print("opcounter: key%s time%s value%s",key,timevalue["timestamp"],timevalue["value"]) 
            
            cloudmongoopcounterquery = {"granularity": 'PT10S',
                                        "hostname": key,
                                        "clusterName":"event-bus-stg-sharded-cluster",
                                        "measurement_type":"OPCOUNTER_QUERY",
                                        "value": timevalue["value"],
                                        "@timestamp": timevalue["timestamp"]}
            #logging.info(cloudmongoopcounterquery)
            print cloudmongoopcounterquery
                    
'''indexname = configuration['GHXEnvironment'].lower() + '-cloudmongo-'\
                    + 'scanandorder'
data_dict = {
   '_op_type': 'index',
   '_index': indexname,
   '_source': cloudmongoscanandorder
   }
logging.info(data_dict)
cloudmongoscanandorders.append(data_dict)
                    
indexname = configuration['GHXEnvironment'].lower() + '-cloudmongo-'\
                    + 'opcounter-query'
data_dict = {
    '_op_type': 'index',
    '_index': indexname,
    '_source': cloudmongoscanandorder
    }
logging.info(data_dict)
cloudmongoopcounterqueries.append(data_dict)
#    hostname_with_value_scan_and_order[key] =
if count >= 1:
    try:
        helpers.bulk(client=es, actions=cloudmongoscanandorders)
        helpers.bulk(client=es, actions=cloudmongoopcounterqueries)
    except Exception as ex:
        logging.exception(ex)
        es.indices.refresh()
        cloudmongoscanandorders = []
        cloudmongoopcounterqueries = []
        count = 0
        exec_endtime = datetime.utcnow()
        total_exec_time = abs(exec_endtime - exec_starttime).seconds'''
'''except Exception as ex:
    logging.exception("message")
finally:
    time.sleep(45 - total_exec_time)'''
logging.info('End')

>>>>>>>>>

#!/usr/bin/python
"""
collects cloud mongo event bus scan and order metric details and push to ES
"""
import json
import time
import logging
import requests
import re
from requests import get
from requests.auth import HTTPDigestAuth
from datetime import datetime, timedelta
from elasticsearch import Elasticsearch, helpers

mms_public_key = 'cigztdwr'
mms_private_key = 'b68db372-6ff0-4e02-907a-534563785cde'

GHX_DEV = '5373a8689194bf134f7a93ad'

configuration = {}
def load_config(configobj, cfile):
    """load configuration details"""
    f = open(cfile, 'r')
    for line in f:
        line = line.strip()
        (param, value) = re.split(':', line, maxsplit=1)
        configobj[param] = value
    f.close()
    return configobj

load_config(configuration, '/opt/conf/cf-params.txt')

def set_subdomain(metaobj):
    """set sub domain details"""
    if metaobj['accountId'] == "050190852521":
        subd = 'awsdsi.ghx.com'
    else:
        subd = 'awsprd.ghx.com'
    return subd

meta = json.loads(get('http://169.254.169.254/latest/dynamic/'\
                      +'instance-identity/document/').content)
instance_id = meta['instanceId']
hostname = meta['privateIp']

subdomain = set_subdomain(meta)

es = Elasticsearch(['http://' + meta['region'] + '-testframework-es.'\
                    + subdomain + ':80'])

def get_clusters(group_id):
    """ pulls data from mms api - by group"""
    r = requests.get('https://cloud.mongodb.com/api/public/v1.0/groups/'\
                     +group_id+'/clusters?',
                     headers={'Accept': 'application/json'},
                     auth=HTTPDigestAuth(mms_public_key, mms_private_key))
    r_json = r.json()
    return r_json['results']

def get_host_with_clusterid(group_id, cluster_id):
    r = requests.get('https://cloud.mongodb.com/api/public/v1.0/groups/'\
                     +group_id+'/hosts?clusterId='+cluster_id,
                     headers={'Accept': 'application/json'},
                     auth=HTTPDigestAuth(mms_public_key, mms_private_key))
    r_json = r.json()
    return r_json['results']

def get_with_meastype_granular_duration(href,granularity,starttime,endtime,
                                        measurementtype,hostname):   
    r = requests.get(href+'/measurements?granularity='+granularity+'&start='\
                         +starttime+'&end='+endtime+'&m='+measurementtype+\
                         '&processId='+hostname+'&pretty=true',
                         headers={'Accept': 'application/json'},
                         auth=HTTPDigestAuth(mms_public_key, mms_private_key))
    r_json = r.json()
    return r_json['measurements']

count = 0
total_exec_time = 0
environment = configuration['GHXEnvironment'].lower()

dateTag = datetime.now().strftime("%Y-%b-%d")
LOG_FILENAME = '/var/log/cloudmetric/cloudmongometriccollection.log_%s.log'
logging.basicConfig(filename=LOG_FILENAME % dateTag, level=logging.INFO)
logging.info('Started')
#while True:
#try:
while True:
    try:
        count += 1
        result_cluster_details = get_clusters(GHX_DEV)
        #print("The result of Cluster is:%s",result_cluster_details)
        clusterid=[]
        hostnameandhref={}
        hostreplicawithip={}

        hostname_with_value_scan_and_order={}
        hostname_with_opcount_query={}
        
        cloudmongoscanandorders = []
        cloudmongoopcounterqueries = []
        now = datetime.utcnow()
        fromdate = (now - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:%S")\
             + "Z"
        todate = now.strftime("%Y-%m-%dT%H:%M:%S") + "Z"
        exec_starttime = datetime.utcnow()
        logging.info(count)
        for id, element in enumerate(result_cluster_details):
           if element["clusterName"] == "event-bus-stg-sharded-cluster"\
           and element["typeName"] == "REPLICA_SET" :
        #        print("NNNNN",element["id"])
               clusterid.append(element["id"])
        #print("The cluster id is :%s",clusterid)
        for clus_id in clusterid:
        #    print("the cluster id",clus_id)
                result_host_details = get_host_with_clusterid(GHX_DEV, clus_id)
        #    print("The result of host is:%s",result_host_details)
                for element in result_host_details:
        #        print("The hostname is :%s and url is:%s",element["hostname"], element["links"])
        #        print("The hostName is:%s",element["hostname"])
      replicawithip = []
                    replicawithip.append(element["ipAddress"])
                    replicawithip.append(element["replicaSetName"])
                    if element["hostname"] not in hostreplicawithip:
                    hostreplicawithip[element["hostname"]] = replicawithip

                    r = element["hostname"]
                    hostnameandhref[r] = element["links"]  
                    for ref in element["links"]:
        #            print("The href is :%s",ref["href"])
                        hostnameandhref[r] = ref["href"]
                        #print(hostnameandhref)
        for key in hostnameandhref:
            scan_order = get_with_meastype_granular_duration(
                    hostnameandhref[key],"PT10S",\
                    fromdate,\
                    todate,\
                    "OPERATIONS_SCAN_AND_ORDER",key)
                        #print(">>>>>>>>>>>>scan_order")
            for datapoint in scan_order:
                                #print(">>>>>>>>>>>>scan_order:%s",datapoint["dataPoints"])
                for timevalue in datapoint["dataPoints"]:
                    #print("scanandorder: key%s time%s value%s",key,timevalue["timestamp"],timevalue["value"]) 
                    if isinstance(timevalue["value"], float):
                    cloudmongoscanandorder = {"granularity": 'PT10S',
                                                "ipwithhostname": hostreplicawithip[key][0]+"-"+key,
                                                "clusterName":"event-bus-stg-sharded-cluster",
"replicaset":hostreplicawithip[key][1],
                                                "measurement_type":"OPERATIONS_SCAN_AND_ORDER",
                                                "value": timevalue["value"],
                                                "@timestamp": timevalue["timestamp"]}
                    #logging.info(cloudmongoscanandorder)
                    print cloudmongoscanandorder
                    indexname = environment + '-cloudmongo-scanandorder'
                    data_dict = {
                            '_op_type': 'index',
                            '_index': indexname,
                            '_source': cloudmongoscanandorder
                            }
                    logging.info(data_dict)
                    cloudmongoscanandorders.append(data_dict)
            opcounter = get_with_meastype_granular_duration(
                    hostnameandhref[key],"PT10S",\
                            fromdate,\
                            todate,\
                            "OPCOUNTER_QUERY",key)
                            #print(">>>>>>>>>>>>opcounter")
            for datapoint in opcounter:
                                #print(">>>>>>>>>>>>opcounter:%s",datapoint["dataPoints"])
                for timevalue in datapoint["dataPoints"]:
                                    #print timevalue 
                    #print("opcounter: key%s time%s value%s",key,timevalue["timestamp"],timevalue["value"]) 
                    if isinstance(timevalue["value"], float):
                    cloudmongoopcounterquery = {"granularity": 'PT10S',
                                                "ipwithhostname": hostreplicawithip[key][0]+"-"+key,
                                                "clusterName":"event-bus-stg-sharded-cluster",
"replicaset":hostreplicawithip[key][1],
                                                "measurement_type":"OPCOUNTER_QUERY",
                                                "value": timevalue["value"],
                                                "@timestamp": timevalue["timestamp"]}
                    #logging.info(cloudmongoopcounterquery)
                    print cloudmongoopcounterquery
                    indexname = environment + '-cloudmongo-opcounter-query'
                    data_dict = {
                            '_op_type': 'index',
                            '_index': indexname,
                            '_source': cloudmongoopcounterquery
                            }
                    logging.info(data_dict)
                    cloudmongoopcounterqueries.append(data_dict)
        if count >= 1:
            try:
                print "start bulk insert"
                helpers.bulk(client=es, actions=cloudmongoscanandorders)
                helpers.bulk(client=es, actions=cloudmongoopcounterqueries)
                print "end bulk insert"
            except Exception as ex:
                logging.exception(ex)
                es.indices.refresh()
                cloudmongoscanandorders = []
                cloudmongoopcounterqueries = []
                count = 0
                exec_endtime = datetime.utcnow()
                total_exec_time = abs(exec_endtime - exec_starttime).seconds
    except Exception as ex:
        logging.exception("message")
    finally:
        time.sleep(45 - total_exec_time)    
print("end")                  
logging.info('End')

>>>>>>>>>>>>>

#!/usr/bin/python
"""
collects dynamodb metrics from newrelic and push to ES
"""
import logging
import time
import json
import re
from datetime import datetime, timedelta
import boto3
import requests
from requests import get
from requests.utils import quote
from elasticsearch import Elasticsearch, helpers

def load_config(configobj, cfile):
    """load configuration details"""
    f = open(cfile, 'r')
    for line in f:
        line = line.strip()
        (param, value) = re.split(':', line, maxsplit=1)
        configobj[param] = value
    f.close()
    return configobj

# end load_config

def set_subdomain(metaobj):
    """set sub domain details"""
    if metaobj['accountId'] == "050190852521":
        subd = 'awsdsi.ghx.com'
    else:
        subd = 'awsprd.ghx.com'
    return subd

dateTag = datetime.now().strftime("%Y-%b-%d")
LOG_FILENAME = '/var/log/dynamoMetrics/dynamoMetrics-collection.log_%s.log'
logging.basicConfig(filename=LOG_FILENAME % dateTag, level=logging.INFO)
logging.info('Started')

configuration = {}
load_config(configuration, '/opt/conf/cf-params.txt')

meta = json.loads(get('http://169.254.169.254/latest/dynamic/instance-identity/document/').content)
instance_id = meta['instanceId']
hostname = meta['privateIp']

subdomain = set_subdomain(meta)

es = Elasticsearch(['http://' + meta['region'] + '-testframework-es.' + subdomain + ':80'])
cw = boto3.resource('ec2', region_name=meta['region'])
count = 0
total_exec_time = 0
env = configuration['GHXEnvironment'].lower()
newrelic_api_insight_url = configuration['NewrelicApiInsightUrl']
newrelic_query_key = configuration['NewrelicQueryKey']
indexname = env + '-newrelic-dynamodb-metrics'
while True:
    try:
        conditional_check_failed = []
        exec_starttime = datetime.utcnow()
        now = datetime.utcnow()
        #nrql_past = (now - timedelta(minutes=1)).strftime("%Y-%m-%d %H:%M:%S")
        #nrql_future = now.strftime("%Y-%m-%d %H:%M:%S")
        current_timestamp = now.strftime("%Y-%m-%dT%H:%M:%S") + "+00:00"
now = datetime.utcnow()
fromdate = (now - timedelta(minutes=1)).strftime("%Y-%m-%dT%H:%M:%S")\
            + "Z"
todate = now.strftime("%Y-%m-%dT%H:%M:%S") + "Z"
exec_starttime = datetime.utcnow()
       
        entity_name = quote("CONTROL_NUMBER_SEQUENCE_" + env)
        nrql_cpu_es_url = newrelic_api_insight_url + "query?nrql=" \
            "SELECT average(provider.conditionalCheckFailedRequests.Average) " \
            "FROM DatastoreSample " \
            "WHERE provider='DynamoDbTable' AND entityName LIKE'" + entity_name +\
            "' SINCE '" + fromdate + "' UNTIL '" + todate + "' FACET " \
            "entityName,label.service"
        nrql_cpu_es_results = requests.get(nrql_cpu_es_url,
                                           headers={"X-Query-Key" : newrelic_query_key,
                                                    "Accept": "application/json"})
        nrql_cpu_es_results_json = nrql_cpu_es_results.json()
        nrql_cpu_es_facets = nrql_cpu_es_results_json['facets']
        for nrql_cpu_es_facet in nrql_cpu_es_facets:
            cpuutilization = {"user_p": nrql_cpu_es_facet['results'][0]['average'],
                              "hostname": "dynamodb-"+entity_name,
                              "metricsType": "avg-conditionalCheckFailed",
                              "@timestamp": current_timestamp}
            logging.debug(cpuutilization)
            data_dict = {
                '_op_type': 'index',
                '_index': indexname,
                '_source': cpuutilization
            }
            conditional_check_failed.append(data_dict)
        try:
            helpers.bulk(client=es, actions=conditional_check_failed)
        except Exception as ex:
            logging.exception(ex)
        logging.info('Insert tpm ES CPU Utilization of Newrelic data into ES')
        es.indices.refresh()
        cpuutilizations = []
        exec_endtime = datetime.utcnow()
        total_exec_time = abs(exec_endtime-exec_starttime).seconds
    except Exception as ex:
        logging.exception("message")
    finally:
        time.sleep(45 - total_exec_time)
logging.info('End')

>>>>>>>>>

logstash / fluentd grok:

input {
    file {
        type => "testresultsjmxjtl"
        path => "/install/jmxtestresults/*/5_output/*.jtl"
        start_position => "beginning"
        sincedb_path => "/var/tmp/.sincedb.jtloutput"
    }
    file {
        type => "testresultsjtl"
        path => "/install/testresults/*/5_output/*.jtl"
        start_position => "beginning"
        sincedb_path => "/var/tmp/.sincedb.jtloutput"
    }
    file {
        type => "jmeter"
        path => "/usr/share/tomcat/jmeter.log"
        start_position => "beginning"
        sincedb_path => "/var/tmp/.sincedb.jmeteroutput"
    }
file {
        type => "testframeworkminion"
        path => "/usr/share/tomcat/test-framework-minion.log"
        start_position => "beginning"
        sincedb_path => "/var/tmp/.sincedb.testframeworkminionoutput"
    }
}

filter {
    if [type] == "testframeworkminion" {
multiline {
  pattern => "^%{TIMESTAMP_ISO8601}"
  negate => "true"
  what => "previous"
}
grok {
  match => [ "message", "(?m)%{TIMESTAMP_ISO8601:time} \|%{LOGLEVEL:loglevel} \[%{GREEDYDATA:threadname}\] %{GREEDYDATA:logmsg}" ]
}
date {
  match => [ "time", "YYYY-MM-dd HH:mm:ss,SSS" ]
  remove_field => [ "time" ]
}
}
if "_grokparsefailure" not in [tags] {
if [type] == "testframeworkminion" {
  mutate {
remove_field => "message"
  }
}
}
    if [type] in ["testresultsjtl","testresultsjmxjtl"] {
        if [message] =~ "^time" {drop {}}
        grok{
            match => ["message","%{DATA:timeStamp},%{NUMBER:elapsed},%{DATA:label},%{DATA:responseCode},%{DATA:responseMessage},%{DATA:threadName},%{DATA:dataType},%{DATA:success},%{DATA:failureMessage},%{NUMBER:bytes},%{NUMBER:sentBytes},%{NUMBER:grpThreads},%{NUMBER:allThreads},%{NUMBER:Latency},%{NUMBER:IdleTime},%{NUMBER:Connect}"]
        }
        mutate {
            convert => [ "elapsed", "integer" ]
            convert => [ "bytes", "integer" ]
            convert => [ "grpThreads", "integer" ]
            convert => [ "allThreads", "integer" ]
            convert => [ "Latency", "integer" ]
            convert => [ "sentBytes", "integer" ]
            convert => [ "Connect", "integer" ]
            convert => [ "IdleTime", "integer" ]
        }
        date {
            match => [ "timeStamp", "ISO8601"]
            target => "timeStamp"
            remove_field  => [ "message" ]
        }
    }
    mutate {
        add_field => {
            "service"        => "SERVICE"
            "ghxhost"        => "IPV4"
            "instanceId"     => "INSTANCEID"
            "ghxenvironment" => "GHXENV"
            "appversion"     => "APPVERSION"
            "buildnumber"    => "BUILDNUMBER"
            "cfstack"        => "CFSTACK"
            "application"    => "APPLICATION"
            "testResultId"   => "TESTRESULTID"
        }
        add_tag => "GHXENV"
    }
}

output {
if [type] == "testresultsjmxjtl" and ([ghxenvironment] == "DEV" or [ghxenvironment] == "STG") {
        elasticsearch {
hosts => [ "https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com:443" ]
            index => "dev-minion-jmx-jtl-logs-%{+YYYY.MM.dd}"
            ilm_enabled => false
}
    }
if [type] == "testresultsjmxjtl" and ([ghxenvironment] != "DEV" and [ghxenvironment] != "STG") {
        elasticsearch {
hosts => [ "https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com:443" ]
            index => "dev-minion-jmx-jtl-logs-%{+YYYY.MM.dd}"
            ilm_enabled => false
}
    }
    if [type] == "testresultsjtl" and ([ghxenvironment] == "DEV" or [ghxenvironment] == "STG") {
        elasticsearch {
hosts => [ "https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com:443" ]
            index => "dev-minion-jtl-logs-%{+YYYY.MM.dd}"
            ilm_enabled => false
}
    }
  if [type] == "testresultsjtl" and ([ghxenvironment] != "DEV" or [ghxenvironment] != "STG") {
        elasticsearch {
hosts => [ "https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com:443" ]
            index => "dev-minion-jtl-logs-%{+YYYY.MM.dd}"
            ilm_enabled => false
}
    }
    if [type] == "jmeter" and ([ghxenvironment] == "DEV" or [ghxenvironment] == "STG") {
    elasticsearch {
hosts => [ "https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com:443" ]
            index => "dev-minion-jmeter-logs-%{+YYYY.MM.dd}"
            ilm_enabled => false
}
    }
if [type] == "jmeter" and ([ghxenvironment] != "DEV" or [ghxenvironment] != "STG") {
    elasticsearch {
hosts => [ "https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com:443" ]
            index => "dev-minion-jmeter-logs-%{+YYYY.MM.dd}"
            ilm_enabled => false
}
    }
if [type] == "testframeworkminion" and ([ghxenvironment] == "DEV" or [ghxenvironment] == "STG") {
elasticsearch {
hosts => [ "https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com:443" ]
            index => "dev-minion-logs-%{+YYYY.MM.dd}"
            ilm_enabled => false
}
}

if [type] == "testframeworkminion" and ([ghxenvironment] != "DEV" or [ghxenvironment] != "STG"){
elasticsearch {
hosts => [ "https://search-test-framework-es7-5r3n4oyw2kddzfmns4oo4okr7m.us-west-2.es.amazonaws.com:443" ]
            index => "dev-minion-logs-%{+YYYY.MM.dd}"
            ilm_enabled => false
}
}
}

>>>>>>>>>>>>>>>>>>>>>>>>>>

 
  wiki analysis:
aspect cg

create snapshot for logs

 

https://hub.ghx.com/pages/viewinfo.action?pageId=99189899

curl -u ${USER_NAME}:${USER_PASSWORD} \
-X PUT \
-H 'Content-Type: application/json' \
--data @modified-page-data.json \
${CONFLUENCE_BASE_URL}'/rest/api/content/'${PAGE_ID} 2>/dev/null \
| jq -r '.id'



curl -u spkannan:Corex@tfw123 -X PUT -H 'Content-Type: application/json' --data @JmeterProgress.png https://hub.ghx.com/'/rest/api/content/'99189899 2>/dev/null | jq -r '.id'


curl -u spkannan:Corex@tfw123 -X PUT -H 'Content-Type: image/png' --data @JmeterProgress.png https://hub.ghx.com/'/rest/api/content/'123933614 2>/dev/null | jq -r '.id'

JmeterProgress.png


https://drive.google.com/drive/folders/1vvO5w9mkhWAjgBmkhedHWWo5anp_mVr5


https://drive.google.com/file/d/1qofPlO44T2y_jq3iikBG5iPbvY86H1-G/view


POST https://wiki.company.com/rest/api/content/{id}/child/attachment

https://developer.atlassian.com/cloud/confluence/rest/api-group-content---attachments/#api-api-content-id-child-attachment-post


curl --cookie wikiCookies.txt --negotiate -k -X POST -u:<username> -g 'https://<someWikiSite>/api.php?action=edit&title=TestPage&text=HelloWorld&token=<someToken>&format=json'


curl --cookie JmeterProgress.png --negotiate -k -X POST -u:spkannan:Corex@tfw123 -g 'https://hub.ghx.com/api.php'--data "text=<some_wiki_tag>this is encoded wiki content</some_wiki_tag>&title=TestPage&text=HelloWorld&token=<someToken>&format=json"



/confluence/rest/api/content/$PAGE_ID/child/attachment


curl -v -S -u admin:admin -X POST -H "X-Atlassian-Token: nocheck" -F "file=@myfile.txt" -F "comment=this is my file" "http://localhost:8080/confluence/rest/api/content/3604482/child/attachment" | python -mjson.tool


curl -v -S -u username:password -X POST -H "X-Atlassian-Token: nocheck" -F "file=@/path/to/local/excelsheet.xls" https://<Confluence server>/display/page




curl -v -S -u spkannan:Corex@tfw123 -X POST -H "X-Atlassian-Token: nocheck" -F "file=@JmeterProgress.png" -F "comment=this is my file" "https://hub.ghx.com/confluence/rest/api/content/3604482/child/attachment" | python -mjson.tool


https://hub.ghx.com/x/rhNjBw

123933614

https://hub.ghx.com/pages/viewinfo.action?pageId=123933614


curl -v -S -u spkannan:Corex@tfw123 -X POST -H "X-Atlassian-Token: nocheck" -F "file=@JmeterProgress.png" -F "comment=this is my file" "https://hub.ghx.com/x/rhNjBw/confluence/rest/api/content/123933614/child/attachment" | python -mpng.tool



https://hub.ghx.com/display/dev/Testing+Wiki

curl -v -S -u spkannan:Corex@tfw123 -X POST -H "X-Atlassian-Token: nocheck" -F "file=@JmeterProgress.png" -F "comment=this is my file" "https://hub.ghx.com/display/dev/Testing+Wiki/confluence/rest/api/content/123933614/child/attachment" | python -mpng.tool


HELP -> CHAT -> QUERY ->RESOLVED -NO RAISE TICKKET

SUMIT QUERY 8 DIGIT NO IMPORTANT


curl -v \
-X POST telligent.mysite.com/.../5678.json \
-H 'Rest-User-Token: xxxxxxxxxxxxxxxxxxx' \
-H "Rest-Method: PUT" \
-F "Body=<SOME_LONG_DATA_FILE.TXT"


curl -v -S -u spkannan:Corex@tfw123 -X POST https://hub.ghx.com/pages/viewpage.action?spaceKey=dev&title=Testing+Wiki/123933614.json -H 'Rest-User-Token: xxxxxxxxxxxxxxxxxxx' -H "Rest-Method: PUT" -F "Body=<JmeterProgress.png" -H "Connection: close" https://hub.ghx.com


curl -v -H "Connection: close" https://hub.ghx.com

 curl -S -u spkannan:Corex@tfw123 -F "file=@localfile;filename=JmeterProgress.png" https://hub.ghx.com

 curl -S -u spkannan:Corex@tfw123 -F profile=@JmeterProgress.png https://hub.ghx.com/pages/viewpage.action?spaceKey=dev&title=Testing+Wiki/123933614.json


 curl -S -u spkannan:Corex@tfw123 -F "story=<JmeterProgress.png" https://hub.ghx.com/

curl -v -S -u spkannan:Corex@tfw123 -X POST -H "X-Atlassian-Token: nocheck" -F "file=@JmeterProgress.png" https://hub.ghx.com/display/dev/Testing+Wiki

curl -v -S -u spkannan:Corex@tfw123 -X GET https://hub.ghx.com/rest/api/content/123933614?expand=space,metadata.labels

curl -D- -u spkannan:Corex@tfw123 -X PUT -H 'X-Atlassian-Token: nocheck' -F 'file=@"JmeterProgress.png"' -F 'minorEdit="true"' -F 'comment="Example attachment comment"; type=image/png; charset=utf-8' https://hub.ghx.com/rest/api/content/123933614/child/attachment

https://hub.ghx.com/rest/quickreload/latest/18483730?since=1617278330280&_=1617278265908



curl --request PUT --url 'https://hub.ghx.com.atlassian.net/wiki/rest/api/content/123933614/child/attachment' --header 'Accept: application/json'

curl -D- -u spkannan:Corex@tfw123 -X POST -H 'X-Atlassian-Token: nocheck' -F 'file=@"JmeterProgress.png"' -F 'minorEdit="true"' -F 'comment="Example attachment comment"; type=image/png; charset=utf-8' http://hub.ghx.com/rest/api/content/123933614/child/attachment


curl -D- -u spkannan:Corex@tfw123 -X POST -H 'X-Atlassian-Token: nocheck' -F 'file=@"JmeterProgress.png"' -F 'minorEdit="true"' -F 'comment="Example attachment comment"; type=image/png; charset=utf-8'https://hub.ghx.com/display/dev/Testing+Wiki'

curl --request POST -k --url 'https://hub.ghx.com.atlassian.net/wiki/rest/api/content/123933614/child/attachment/1/data' --header 'Accept: image/png' -d '{"file": "/home/sys-user/Documents/JmeterProgress.png","comment": "TEestssss","minorEdit": "true"}'

https://hub.ghx.com/synchrony-proxy/v1/data/Synchrony-57979759-3645-33ce-b0d5-7ed26f834106/confluence-123933614?state-at=@head&state-format=type-tagged&rewrite-request=true&cached=true


curl --request POST -u spkannan:Corex@tfw123 -F 'file=@"JmeterProgress.png" --url 'https://hub.ghx.com/pages/doeditpage.action?pageId=123933614' --header 'Accept: image/png'
Request Method: POST

curl -u $USER_NAME:$USER_PASSWORD -X POST -H "X-Atlassian-Token: nocheck" -F "file=@${ATTACHMENT_FILE_NAME}" -F "comment=File attached via REST API" ${CONFLUENCE_BASE_URL}/rest/api/content/${PAGE_ID}/child/attachment 2>/dev/null | jq -r '.results[].title'

curl -u spkannan:Corex@tfw123 -X POST -H "X-Atlassian-Token: nocheck" -F "file=@JmeterProgress.png" -F "comment=File attached via REST API" https://hub.ghx.com/rest/api/content/123933614/child/attachment 2>/dev/null | jq -r '.results[].title'

Working:
curl -u spkannan:Corex@tfw123 -X POST -H "X-Atlassian-Token: nocheck" -F "file=@JmeterProgress.png" -F "comment=File attached via REST API" https://hub.ghx.com/rest/api/content/123933614/child/attachment 2>/dev/null | jq -r '.results[].title'


cd /home/sys-user/Downloads && { curl -u spkannan:Corex@tfw123 -X POST -H "X-Atlassian-Token: nocheck" -F "file=@_tmp_graphMetrics.pdf" -F "comment=File attached via REST API" https://hub.ghx.com/rest/api/content/123933614/child/attachment 2>/dev/null | jq -r '.results[].title'; } 

cd /home/sys-user/Downloads && { curl -u spkannan:Corex@tfw123 -X POST -H "X-Atlassian-Token: nocheck" -F "file=@JmeterProgress.png" -F "comment=File attached via REST API" https://hub.ghx.com/rest/api/content/123933614/child/attachment 2>/dev/null | jq -r '.results[].title'; }

cd /home/sys-user/Downloads && { curl -u spkannan:Corex@tfw123 -X POST -H "X-Atlassian-Token: nocheck" -F "file=@_tmp_graphMetrics.pdf" -F "comment=File attached via REST API" https://hub.ghx.com/rest/api/content/123933614/child/attachment 2>/dev/null | jq -r '.results[].title'; }



/*
         * String command =
         * "cd /home/sys-user/Downloads && "
         * + "{ curl -u spkannan:Corex@tfw123 -X POST "
         * + "-H \"X-Atlassian-Token: nocheck\" -F \"file=@_tmp_graphMetrics.pdf\" -F "
         * + "\"comment=File attached via REST API\" "
         * + "https://hub.ghx.com/rest/api/content/123933614/child/attachment 2>/dev/null "
         * + "| jq -r '.results[].title'; }";
         */
        try {

              String command = "cd /home/sys-user/Downloads && { curl -u spkannan:Corex@tfw123 -X POST -H \"X-Atlassian-Token: nocheck\" -F \"file=@_tmp_graphMetrics.pdf\" -F \"comment=File attached via REST API\" https://hub.ghx.com/rest/api/content/123933614/child/attachment 2>/dev/null | jq -r '.results[].title'; } \n" + 
                      "";
             
            
            //String command = "ls";

          //  ProcessBuilder processBuilder = new ProcessBuilder(command.split(" "));
              
              Codec codec = new UnixCodec();
              Process p1 = Runtime.getRuntime().exec(command.split(" "));
              InputStream input = p1.getInputStream();
              
            ProcessBuilder processBuilder = new ProcessBuilder(command);

           // processBuilder.directory(new File("/home/sys-user/Downloads"));
            Process process = processBuilder.start();
            InputStream inputStream = process.getInputStream();
            System.out.println("InputStream" + inputStream);
            Process process1 = Runtime.getRuntime().exec(command);
            process1.getInputStream();
            process1.destroy();

        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        File file = new File("/tmp/graphMetrics.pdf");
        file.delete();
    }
    
    public static void main(String[] args) {
        //String command = "/usr/bin/curl -u spkannan:Corex@tfw123 -XPOST -H \"X-Atlassian-Token: nocheck\" -F \"file=@/home/sys-user/Downloads/_tmp_graphMetrics.pdf\" -F \"comment=File attached via REST API\" https://hub.ghx.com/rest/api/content/123933614/child/attachment 2>/dev/null | jq -r '.results[].title'";
       // String[] command = {"curl" "-k" "-i" "-X" POST "-H" "Content-Type: multipart/form-data" --cookie "rsession=your rsession" "Content-Type:application/json" --data{branchName+":"+branchId":"+sourceBranch":",+alias}};

        try {
            ProcessBuilder processBuilder = new ProcessBuilder(command);
            /*
             * ProcessBuilder processBuilder =new ProcessBuilder( "/usr/bin/curl",
             * 
             * 
             * "-u spkannan:Corex@tfw123",
             * "-XPOST",
             * "-H", "X-Atlassian-Token: nocheck",
             * "-F", "file=@_tmp_graphMetrics.pdf",
             * "comment=File attached via REST API",
             * "https://hub.ghx.com/rest/api/content/123933614/child/attachment",
             * "2>/dev/null", "|","jq", "-r",
             * "-'.results[].title'"
             * );
             */
            processBuilder.directory(new File("/home/sys-user/Downloads"));
            Process process = processBuilder.start();
            InputStream inputStream = process.getInputStream();
        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

import numpy as np
import matplotlib.pyplot as plt

# data to plot
n_groups = 4
means_Resolved = (90, 55, 40, 65)
means_Success = (85, 62, 54, 20)
means_Inprogress = (70, 12, 50, 80)
means_Error = (10,79,32,55)

# create plot
fig, ax = plt.subplots()
index = np.arange(n_groups)
bar_width = 0.10
opacity = 0.8

rects1 = plt.bar(index, means_Resolved, bar_width,
alpha=opacity,
color='b',
label='Resolved')

rects2 = plt.bar(index + bar_width, means_Success, bar_width,
alpha=opacity,
color='g',
label='Success')

rects3 = plt.bar(index + bar_width+bar_width, means_Inprogress, bar_width,
alpha=opacity,
color='y',
label='Inprogress')

rects3 = plt.bar(index + bar_width+bar_width+bar_width, means_Error,\
         bar_width,
alpha=opacity,
color='r',
label='Error')

plt.xlabel('Doc Flow Comparision rate')
plt.ylabel('Scores')
plt.title('Scores by each test Run')
plt.xticks(index + bar_width, ('Test1', 'Test2', 'Test3', 'Test4'))
plt.legend()

plt.tight_layout()
plt.show()



Short circuiting ,intermediate and terminal operation

https://www.javabrahman.com/java-8/understanding-java-8-streams-operations-intermediate-and-terminal-operations-tutorial-with-examples/

https://www.logicbig.com/tutorials/core-java-tutorial/java-util-stream/short-circuiting.html

optional – java 8

.orElseThrow

Example: Java String lastIndexOf(int ch) Method

Examples of Using Java’s CompletableFuture

forkjoinpool java

GWT - UiBinder


ull, null]&#x29;
From Date ----------------->2021-06-17T14:54:51.923Z
To Date ----------------->2021-06-17T15:25:35.216Z
SimpleDateFormatFrom Date ----------------->Thu Jun 17 14:54:51 GMT 2021
SimpleDateFormat To Date ----------------->Thu Jun 17 14:54:51 GMT 2021
Thu Jun 17 14:54:51 GMT 2021
Thu Jun 17 15:25:35 GMT 2021
dateConversion from dateThu Jun 17 14:54:51 GMT 2021
dateConversion to dateThu Jun 17 15:25:35 GMT 2021
engineName:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Engine-PE
name>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>bus.publish.events.per.hour
fromDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
res>>>>>>>>>>>>>>>>>>>>>>>>>>>>dev.morphia.query.internal.MorphiaCursor@6e17cc39
IteratorUtils.toList(res)>>>>>>>>>>>>>>>>>>>>>......>>>>>>>>>>>>>>>....[EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=56, engineName=Engine-PE, totalValue=37899.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=14, engineName=Engine-PE, totalValue=1466.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=21, engineName=Engine-PE, totalValue=2272.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=20, engineName=Engine-PE, totalValue=2175.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=11, engineName=Engine-PE, totalValue=1209.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=17, engineName=Engine-PE, totalValue=1822.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=15, engineName=Engine-PE, totalValue=1572.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=0, engineName=Engine-PE, totalValue=38283.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=7, engineName=Engine-PE, totalValue=868.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=18, engineName=Engine-PE, totalValue=1845.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=4, engineName=Engine-PE, totalValue=554.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=55, engineName=Engine-PE, totalValue=37876.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=57, engineName=Engine-PE, totalValue=37946.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=9, engineName=Engine-PE, totalValue=945.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=8, engineName=Engine-PE, totalValue=922.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=1, engineName=Engine-PE, totalValue=152.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=16, engineName=Engine-PE, totalValue=1744.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=3, engineName=Engine-PE, totalValue=381.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=13, engineName=Engine-PE, totalValue=1399.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=58, engineName=Engine-PE, totalValue=38115.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=6, engineName=Engine-PE, totalValue=600.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=10, engineName=Engine-PE, totalValue=1051.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=5, engineName=Engine-PE, totalValue=577.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=22, engineName=Engine-PE, totalValue=2514.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=12, engineName=Engine-PE, totalValue=1293.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=59, engineName=Engine-PE, totalValue=38234.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=2, engineName=Engine-PE, totalValue=231.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=19, engineName=Engine-PE, totalValue=2027.0)]
PerHour
ebExecutionRunTimeBusinessStatisticsAggregation>>>>[]
engineName:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Engine-DataPoller
name>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>bus.publish.events.per.hour
fromDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
res>>>>>>>>>>>>>>>>>>>>>>>>>>>>dev.morphia.query.internal.MorphiaCursor@76cbfe01
IteratorUtils.toList(res)>>>>>>>>>>>>>>>>>>>>>......>>>>>>>>>>>>>>>....[EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=4, engineName=Engine-DataPoller, totalValue=17.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=9, engineName=Engine-DataPoller, totalValue=26.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=13, engineName=Engine-DataPoller, totalValue=41.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=7, engineName=Engine-DataPoller, totalValue=25.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=18, engineName=Engine-DataPoller, totalValue=56.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=21, engineName=Engine-DataPoller, totalValue=65.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=17, engineName=Engine-DataPoller, totalValue=56.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=57, engineName=Engine-DataPoller, totalValue=1480.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=14, engineName=Engine-DataPoller, totalValue=43.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=5, engineName=Engine-DataPoller, totalValue=17.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=0, engineName=Engine-DataPoller, totalValue=1490.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=12, engineName=Engine-DataPoller, totalValue=38.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=10, engineName=Engine-DataPoller, totalValue=29.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=2, engineName=Engine-DataPoller, totalValue=6.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=55, engineName=Engine-DataPoller, totalValue=1479.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=1, engineName=Engine-DataPoller, totalValue=4.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=6, engineName=Engine-DataPoller, totalValue=17.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=59, engineName=Engine-DataPoller, totalValue=1489.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=15, engineName=Engine-DataPoller, totalValue=47.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=56, engineName=Engine-DataPoller, totalValue=1479.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=3, engineName=Engine-DataPoller, totalValue=11.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=16, engineName=Engine-DataPoller, totalValue=53.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=8, engineName=Engine-DataPoller, totalValue=26.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=22, engineName=Engine-DataPoller, totalValue=69.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=11, engineName=Engine-DataPoller, totalValue=35.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=19, engineName=Engine-DataPoller, totalValue=63.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=20, engineName=Engine-DataPoller, totalValue=65.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=58, engineName=Engine-DataPoller, totalValue=1485.0)]
PerHour
ebExecutionRunTimeBusinessStatisticsAggregation>>>>[]
engineName:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Engine-IO
name>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>bus.publish.events.per.hour
fromDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
res>>>>>>>>>>>>>>>>>>>>>>>>>>>>dev.morphia.query.internal.MorphiaCursor@caf9495
IteratorUtils.toList(res)>>>>>>>>>>>>>>>>>>>>>......>>>>>>>>>>>>>>>....[EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=15, engineName=Engine-IO, totalValue=385.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=58, engineName=Engine-IO, totalValue=3567.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=59, engineName=Engine-IO, totalValue=3596.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=3, engineName=Engine-IO, totalValue=85.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=5, engineName=Engine-IO, totalValue=131.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=20, engineName=Engine-IO, totalValue=541.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=56, engineName=Engine-IO, totalValue=3515.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=4, engineName=Engine-IO, totalValue=111.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=21, engineName=Engine-IO, totalValue=609.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=0, engineName=Engine-IO, totalValue=3616.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=1, engineName=Engine-IO, totalValue=28.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=22, engineName=Engine-IO, totalValue=679.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=2, engineName=Engine-IO, totalValue=52.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=10, engineName=Engine-IO, totalValue=260.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=17, engineName=Engine-IO, totalValue=438.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=8, engineName=Engine-IO, totalValue=210.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=14, engineName=Engine-IO, totalValue=358.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=13, engineName=Engine-IO, totalValue=337.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=12, engineName=Engine-IO, totalValue=309.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=16, engineName=Engine-IO, totalValue=414.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=7, engineName=Engine-IO, totalValue=190.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=9, engineName=Engine-IO, totalValue=230.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=55, engineName=Engine-IO, totalValue=3494.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=18, engineName=Engine-IO, totalValue=458.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=19, engineName=Engine-IO, totalValue=493.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=6, engineName=Engine-IO, totalValue=151.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=11, engineName=Engine-IO, totalValue=285.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=57, engineName=Engine-IO, totalValue=3539.0)]
PerHour
ebExecutionRunTimeBusinessStatisticsAggregation>>>>[]
PerSec
FromDate:>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021and toDatThu Jun 17 15:25:35 GMT 2021
engineName:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Engine-PE
name>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>bus.publish.events.per.second
fromDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
res>>>>>>>>>>>>>>>>>>>>>>>>>>>>dev.morphia.query.internal.MorphiaCursor@3a64fa49
IteratorUtils.toList(res)>>>>>>>>>>>>>>>>>>>>>......>>>>>>>>>>>>>>>....[EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=56, engineName=Engine-PE, totalValue=0.38333333333333336), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=14, engineName=Engine-PE, totalValue=1.1166666666666667), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=21, engineName=Engine-PE, totalValue=1.6440677966101696), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=19, engineName=Engine-PE, totalValue=3.033333333333333), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=11, engineName=Engine-PE, totalValue=2.6779661016949152), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=17, engineName=Engine-PE, totalValue=1.3220338983050848), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=15, engineName=Engine-PE, totalValue=1.7966101694915255), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=0, engineName=Engine-PE, totalValue=0.8166666666666667), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=7, engineName=Engine-PE, totalValue=4.466666666666667), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=4, engineName=Engine-PE, totalValue=2.9322033898305087), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=18, engineName=Engine-PE, totalValue=0.3898305084745763), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=55, engineName=Engine-PE, totalValue=4.1), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=57, engineName=Engine-PE, totalValue=0.7966101694915254), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=9, engineName=Engine-PE, totalValue=0.38333333333333336), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=8, engineName=Engine-PE, totalValue=0.9), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=1, engineName=Engine-PE, totalValue=2.5762711864406778), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=16, engineName=Engine-PE, totalValue=2.8666666666666667), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=3, engineName=Engine-PE, totalValue=2.5), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=13, engineName=Engine-PE, totalValue=1.7666666666666666), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=58, engineName=Engine-PE, totalValue=2.864406779661017), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=6, engineName=Engine-PE, totalValue=0.3898305084745763), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=10, engineName=Engine-PE, totalValue=1.7966101694915255), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=5, engineName=Engine-PE, totalValue=0.38333333333333336), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=22, engineName=Engine-PE, totalValue=4.033333333333333), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=20, engineName=Engine-PE, totalValue=2.466666666666667), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=12, engineName=Engine-PE, totalValue=1.423728813559322), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=59, engineName=Engine-PE, totalValue=1.9833333333333334), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=2, engineName=Engine-PE, totalValue=1.3389830508474576)]
ebExecutionRunTimeBusinessStatisticsAggregation:[]
PerSec
FromDate:>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021and toDatThu Jun 17 15:25:35 GMT 2021
engineName:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Engine-DataPoller
name>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>bus.publish.events.per.second
fromDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
res>>>>>>>>>>>>>>>>>>>>>>>>>>>>dev.morphia.query.internal.MorphiaCursor@6ac29f38
IteratorUtils.toList(res)>>>>>>>>>>>>>>>>>>>>>......>>>>>>>>>>>>>>>....[EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=4, engineName=Engine-DataPoller, totalValue=0.1), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=9, engineName=Engine-DataPoller, totalValue=0.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=18, engineName=Engine-DataPoller, totalValue=0.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=21, engineName=Engine-DataPoller, totalValue=0.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=13, engineName=Engine-DataPoller, totalValue=0.05), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=7, engineName=Engine-DataPoller, totalValue=0.13333333333333333), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=17, engineName=Engine-DataPoller, totalValue=0.05), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=57, engineName=Engine-DataPoller, totalValue=0.01694915254237288), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=14, engineName=Engine-DataPoller, totalValue=0.03389830508474576), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=5, engineName=Engine-DataPoller, totalValue=0.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=0, engineName=Engine-DataPoller, totalValue=0.01694915254237288), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=12, engineName=Engine-DataPoller, totalValue=0.05), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=10, engineName=Engine-DataPoller, totalValue=0.05084745762711865), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=2, engineName=Engine-DataPoller, totalValue=0.03389830508474576), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=55, engineName=Engine-DataPoller, totalValue=0.16666666666666666), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=1, engineName=Engine-DataPoller, totalValue=0.06666666666666667), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=15, engineName=Engine-DataPoller, totalValue=0.06779661016949153), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=59, engineName=Engine-DataPoller, totalValue=0.06666666666666667), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=6, engineName=Engine-DataPoller, totalValue=0.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=56, engineName=Engine-DataPoller, totalValue=0.0), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=3, engineName=Engine-DataPoller, totalValue=0.08333333333333333), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=16, engineName=Engine-DataPoller, totalValue=0.1), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=8, engineName=Engine-DataPoller, totalValue=0.01694915254237288), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=22, engineName=Engine-DataPoller, totalValue=0.06779661016949153), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=11, engineName=Engine-DataPoller, totalValue=0.1), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=19, engineName=Engine-DataPoller, totalValue=0.11666666666666667), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=20, engineName=Engine-DataPoller, totalValue=0.03389830508474576), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=58, engineName=Engine-DataPoller, totalValue=0.0847457627118644)]
ebExecutionRunTimeBusinessStatisticsAggregation:[]
PerSec
FromDate:>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021and toDatThu Jun 17 15:25:35 GMT 2021
engineName:>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Engine-IO
name>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>bus.publish.events.per.second
fromDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDate>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
res>>>>>>>>>>>>>>>>>>>>>>>>>>>>dev.morphia.query.internal.MorphiaCursor@43d05f97
IteratorUtils.toList(res)>>>>>>>>>>>>>>>>>>>>>......>>>>>>>>>>>>>>>....[EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=15, engineName=Engine-IO, totalValue=0.4576271186440678), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=58, engineName=Engine-IO, totalValue=0.4745762711864407), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=59, engineName=Engine-IO, totalValue=0.4915254237288136), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=3, engineName=Engine-IO, totalValue=0.55), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=5, engineName=Engine-IO, totalValue=0.3389830508474576), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=20, engineName=Engine-IO, totalValue=0.8), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=56, engineName=Engine-IO, totalValue=0.3559322033898305), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=4, engineName=Engine-IO, totalValue=0.4406779661016949), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=21, engineName=Engine-IO, totalValue=1.1333333333333333), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=0, engineName=Engine-IO, totalValue=0.3333333333333333), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=1, engineName=Engine-IO, totalValue=0.4745762711864407), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=22, engineName=Engine-IO, totalValue=1.1864406779661016), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=2, engineName=Engine-IO, totalValue=0.4), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=10, engineName=Engine-IO, totalValue=0.5), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=17, engineName=Engine-IO, totalValue=0.4), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=8, engineName=Engine-IO, totalValue=0.3333333333333333), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=14, engineName=Engine-IO, totalValue=0.35), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=13, engineName=Engine-IO, totalValue=0.4745762711864407), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=12, engineName=Engine-IO, totalValue=0.4), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=16, engineName=Engine-IO, totalValue=0.4915254237288136), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=7, engineName=Engine-IO, totalValue=0.6610169491525424), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=9, engineName=Engine-IO, totalValue=0.3333333333333333), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=55, engineName=Engine-IO, totalValue=0.5932203389830508), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=18, engineName=Engine-IO, totalValue=0.3389830508474576), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=19, engineName=Engine-IO, totalValue=0.5833333333333334), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=6, engineName=Engine-IO, totalValue=0.3333333333333333), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=15, minutes=11, engineName=Engine-IO, totalValue=0.423728813559322), EBExecutionRunTimeBusinessStatisticsAggregation(month=6, day=17, year=2021, hour=14, minutes=57, engineName=Engine-IO, totalValue=0.4)]
ebExecutionRunTimeBusinessStatisticsAggregation:[]
All-------------------------------
engine>>>>>>>>>>>>>>>>>>>>>Engine-PE
fromDat>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDat>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
All-------------------------------
engine>>>>>>>>>>>>>>>>>>>>>Engine-DataPoller
fromDat>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDat>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
All-------------------------------
engine>>>>>>>>>>>>>>>>>>>>>Engine-IO
fromDat>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDat>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
ebExecutionRunTimeBusinessStatisticsAggs..................[]
engine>>>>>>>>.Engine-PE
fromDat>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDat>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
ebExecutionRunTimeBusinessStatisticsAggs>>>>>>>>>>>>>>>[]
engine>>>>>>>>.Engine-DataPoller
fromDat>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDat>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
ebExecutionRunTimeBusinessStatisticsAggs>>>>>>>>>>>>>>>[]
engine>>>>>>>>.Engine-IO
fromDat>>>>>>>>>>>>>>>>>>>>Thu Jun 17 14:54:51 GMT 2021
toDat>>>>>>>>>>>>>>>>>>>>>>>>>Thu Jun 17 15:25:35 GMT 2021
ebExecutionRunTimeBusinessStatisticsAggs>>>>>>>>>>>>>>>[]
ebExecutionRunTimeBusinessStatisticsAggs 2888[]
2021-06-17 18:30:54,984 |INFO [https-jsse-nio-8443-exec-33] c.g.h.service.GHXHeimdallSecurityAspect - Access to com.ghx.testframework.api.rest.PerformanceMetricsRESTService granted to getPerformanceMetricsStatForNewrelic.[Eventbus Published Per Hour, eventbus_published, 2021-06-17T14:54:51.923Z, 2021-06-17T15:25:35.216Z, 1m, chart, All, 60cb60b428ef2b650f9d1bed, null, null, null, null]&#x28;user spkannan (id=3497049)&#x29;
2021-06-17 18:30:54,985 |DEBUG [https-jsse-nio-8443-exec-33] o.s.w.s.m.m.a.RequestResponseBodyMethodProcessor - Written [{data=[], keys=[], groupByItems={Engine-DataPoller=Engine-DataPoller, Engine-PE=Engine-PE, Engine-IO=Engine-IO}}] as "application/json" using [com.ghx.web.converter.CustomJackson2HttpMessageConverter@5574a23b]
2021-06-17 18:31:00,190 |INFO [https-jsse-nio-8443-exec-6] com.ghx.web.filter.security.CRLFFilter - Url &#x3a; 
2021-06-17 18:31:00,190 |INFO [https-jsse-nio-8443-exec-6] com.ghx.web.filter.security.CRLFFilter - CRLF enabled true
2021-06-17 18:31:00,191 |DEBUG [https-jsse-nio-8443-exec-6] o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /rest/ping
2021-06-17 18:31:00,191 |DEBUG [https-jsse-nio-8443-exec-6] o.s.w.s.m.m.a.RequestMappingHandlerMapping - Did not find handler method for [/rest/ping]
2021-06-17 18:31:00,191 |DEBUG [https-jsse-nio-8443-exec-6] o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /rest/ping
2021-06-17 18:31:00,191 |DEBUG [https-jsse-nio-8443-exec-6] o.s.w.s.m.m.a.RequestMappingHandlerMapping - Returning handler method [public org.springframework.http.ResponseEntity<java.lang.String> com.ghx.rest.common.service.rest.HealthCheckREST.ping()]
2021-06-17 18:31:00,191 |INFO [https-jsse-nio-8443-exec-6] com.ghx.rest.common.service.GHXSecurityAspect - user anonymous (id=-1) attempt to access com.ghx.rest.common.service.rest.HealthCheckREST.ping&#x28;[]&#x29;
2021-06-17 18:31:00,192 |INFO [https-jsse-nio-8443-exec-6] com.ghx.rest.common.service.GHXSecurityAspect - Access to com.ghx.rest.common.service.rest.HealthCheckREST granted to ping.[]&#x28;user anonymous (id=-1)&#x29;
2021-06-17 18:31:00,193 |DEBUG [https-jsse-nio-8443-exec-6] o.s.w.s.m.m.a.HttpEntityMethodProcessor - Written [I'm up!: Thu Jun 17 18:31:00 GMT 2021] as "application/json" using [com.ghx.web.converter.CustomJackson2HttpMessageConverter@5574a23b]
2021-06-17 18:31:02,950 |WARN [EGXLocal-EVENT_BUS_SCHEDULER_Worker-1] com.ghx.eb.impl.rebalance.ListenerRebalancer - LISTENER_REBALANCER CACHE - Null or empty map returned from listenerStatusService.retrieveAll&#x28;i-0d91b02bffc517f7c&#x29;
2021-06-17 18:31:02,950 |INFO [EGXLocal-EVENT_BUS_SCHEDULER_Worker-1] com.ghx.eb.impl.rebalance.ListenerRebalancer - 
Listener CACHE:Local :
2021-06-17 18:31:04,965 |INFO [https-jsse-nio-8443-exec-1] com.ghx.web.filter.security.CRLFFilter - Url &#x3a; 
2021-06-17 18:31:04,966 |INFO [https-jsse-nio-8443-exec-1] com.ghx.web.filter.security.CRLFFilter - CRLF enabled true
2021-06-17 18:31:04,966 |DEBUG [https-jsse-nio-8443-exec-1] o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /rest/ping
2021-06-17 18:31:04,966 |DEBUG [https-jsse-nio-8443-exec-1] o.s.w.s.m.m.a.RequestMappingHandlerMapping - Did not find handler method for [/rest/ping]
2021-06-17 18:31:04,966 |DEBUG [https-jsse-nio-8443-exec-1] o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /rest/ping
2021-06-17 18:31:04,967 |DEBUG [https-jsse-nio-8443-exec-1] o.s.w.s.m.m.a.RequestMappingHandlerMapping - Returning handler method [public org.springframework.http.ResponseEntity<java.lang.String> com.ghx.rest.common.service.rest.HealthCheckREST.ping()]
2021-06-17 18:31:04,967 |INFO [https-jsse-nio-8443-exec-1] com.ghx.rest.common.service.GHXSecurityAspect - user anonymous (id=-1) attempt to access com.ghx.rest.common.service.rest.HealthCheckREST.ping&#x28;[]&#x29;
2021-06-17 18:31:04,967 |INFO [https-jsse-nio-8443-exec-1] com.ghx.rest.common.service.GHXSecurityAspect - Access to com.ghx.rest.common.service.rest.HealthCheckREST granted to ping.[]&#x28;user anonymous (id=-1)&#x29;
2021-06-17 18:31:04,968 |DEBUG [https-jsse-nio-8443-exec-1] o.s.w.s.m.m.a.HttpEntityMethodProcessor - Written [I'm up!: Thu Jun 17 18:31:04 GMT 2021] as "application/json" using [com.ghx.web.converter.CustomJackson2HttpMessageConverter@5574a23b]
2021-06-17 18:31:05,912 |INFO [https-jsse-nio-8443-exec-31] com.ghx.web.filter.security.CRLFFilter - Url &#x3a; 
2021-06-17 18:31:05,912 |INFO [https-jsse-nio-8443-exec-31] com.ghx.web.filter.security.CRLFFilter - CRLF enabled true
2021-06-17 18:31:05,912 |DEBUG [https-jsse-nio-8443-exec-31] o.s.w.s.m.m.a.RequestMappingHandlerMapping - Looking up handler method for path /rest/healthstats/dashboard/stoppedAndThrottled
2021-06-17 18:31:05,912 |DEBUG [https-jsse-nio-8443-exec-31] o.s.w.s.m







https://corex-dev.awsdsi.ghx.com/rest/testframework/performance/metrics/newrelic?chartGroup=eventbus_published&chartName=Eventbus+Published+Per+Second&filterType=Engine-DataPoller&fromDate=2021-06-17T11:40:02.129Z&interval=1m&testResultId=60cb331928ef2b650f9b8a71&toDate=2021-06-17T11:49:56.579Z&viewType=chart

https://internal-testfw-cxtf-2128-ui-heimdall-elb-1914893981.us-west-2.elb.amazonaws.com/rest/testframework/performance/metrics/newrelic?chartGroup=eventbus_published&chartName=Eventbus+Published+Per+Second&filterType=Engine-DataPoller&fromDate=2021-06-17T11:40:02.129Z&interval=1m&testResultId=60cb331928ef2b650f9b8a71&toDate=2021-06-17T11:50:29.773Z&viewType=chart









curl -H "Content-Type: application/json" -XGET 'https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_search?pretty' -d '
{
"query":{
"bool":{
"must":[
{
"range":{
"@timestamp":{
"gte":"1623203047000",
"lte":"1623289447000"
}
}
},
{"range":{
"user_p" : {"gt": 50.2}
}},
{"match":{
"application" : "DEV-jobs"
}},
{
"range":{
"user_p":{
"gt":"0"
}
}
}
]
}
}
}'



curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": ""}}
      ]
    }
  }
}
'


curl -X POST https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_delete_by_query" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "firstName":"Prashant"
    }
  }
}
'

curl -X POST "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "application": ""
    }
  }
}
'

dev-newrelic-max-cpu-utilization


curl -X POST "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-max-cpu-utilization/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "application": ""
    }
  }
}
'


curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-max-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": ""}}
      ]
    }
  }
}
'

dev regapi not available in both new and old newrelic accounts


curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-max-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": "STG-jobs"}}
      ]
    }
  }
}
'

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": "STG-jobs"}}
      ]
    }
  }
}
'

curl -X POST "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-max-cpu-utilization/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "application": "STG-jobs"
    }
  }
}
'

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": "STG MONGO AUDIT"}}
      ]
    }
  }
}
'

curl -X POST "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "application": "STG MONGO AUDIT"
    }
  }
}
'

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": "STG MONGO EB EXECUTION"}}
      ]
    }
  }
}
'

curl -X POST "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "application": "STG MONGO EB EXECUTION"
    }
  }
}
'

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-max-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": "STG MONGO AUDIT"}}
      ]
    }
  }
}
'


curl -X POST "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-max-cpu-utilization/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "application": "STG MONGO AUDIT"
    }
  }
}
'

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-max-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": "STG MONGO EB EXECUTION"}}
      ]
    }
  }
}
'

curl -X POST "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-max-cpu-utilization/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "application": "STG MONGO EB EXECUTION"
    }
  }
}
'


curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-max-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": "STG MONGO BUSINESS TRANSACTION"}}
      ]
    }
  }
}
'

curl -X POST "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "application": "STG MONGO EB EXECUTION"
    }
  }
}
'

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": "STG MONGO BUSINESS TRANSACTION"}}
      ]
    }
  }
}
'

curl -X POST "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "application": "STG MONGO BUSINESS TRANSACTION"
    }
  }
}
'

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": ""}}
      ]
    }
  }
}
'

curl -X POST "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-cpu-utilization/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "application": ""
    }
  }
}
'

curl -X GET "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-max-cpu-utilization/_search?pretty" -H 'Content-Type: application/json' -d'
{
  "query": { 
    "bool": { 
      "must": [
        { "match": { "application": ""}}
      ]
    }
  }
}
'

curl -X POST "https://vpc-test-framework-es7-vpc-b4flsoliewpodkvnqdyc75dtqa.us-west-2.es.amazonaws.com/dev-newrelic-max-cpu-utilization/_delete_by_query?pretty" -H 'Content-Type: application/json' -d'
{
  "query": {
    "match": {
      "application": ""
    }
  }
}
'

curl -D -u spkannan:Corex@tfw123 -X GET -H "Content-Type: application/json" https://workflow.ghx.com/rest/api/2/search?jql=assignee=spkannan


Seems we can do using bots and api's.
Also with python it is more easy with pybot but we need this integration in Java.
 
Trying few java codes

MediaWikiBot

Wiki.LogEntry

Curl command will also work for posting file and messages

[https://www.codota.com/code/java/methods/org.wikipedia.Wiki/getUploads
] https://www.mediawiki.org/wiki/Topic:Rqroucz666g8gi8o

https://confluence.atlassian.com/confkb/using-the-confluence-rest-api-to-upload-an-attachment-to-one-or-more-pages-1014274390.html

https://www.mediawiki.org/wiki/Manual:Creating_a_bot

 

https://github.com/addwiki/mediawiki-api

https://www.mediawiki.org/wiki/Manual:Creating_a_bot

https://github.com/addwiki/mediawiki-api-base



we could able to upload image as attachement to Testing page.

I create a page called Testing wiki and uploaded JmeterProgress.png from my local machine to wiki via curl command


I had internal discussion with Sivakumaran Palanichamy, he suggested to analyse on uploading to wiki.

curl -u spkannan:Corex@tfw123 -X POST -H "X-Atlassian-Token: nocheck" -F "file=@JmeterProgress.png" -F "comment=File attached via REST API" https://hub.ghx.com/rest/api/content/123933614/child/attachment 2>/dev/null | jq -r '.results[].title'

 

derived curl command to upload file to wiki after working out and analysing multiple curl commands

RDS egx-tpm-dev-01:

cpu

https://one.newrelic.com/launcher/nr1-core.explorer?launcher=eyJVTlNUQUJMRV9maWx0ZXJzIjpbeyJ0eXBlIjoidGFnIiwidmFsdWUiOnsia2V5IjoiYXdzLmRiSW5zdGFuY2VJZGVudGlmaWVyIiwidmFsdWUiOiJlZ3gtdHBtLWRldi0wMSJ9fV0sInRhZ3MiOnt9fQ==&pane=eyJuZXJkbGV0SWQiOiJucjEtY29yZS5saXN0aW5nIiwiZW50aXR5RG9tYWluIjoiSU5GUkEiLCJlbnRpdHlUeXBlIjoiQVdTUkRTREJJTlNUQU5DRSJ9&sidebars[0]=eyJuZXJkbGV0SWQiOiJucjEtY29yZS5jYXRlZ29yaWVzIiwic2VsZWN0ZWRDYXRlZ29yeSI6eyJlbnRpdHlEb21haW4iOiJJTkZSQSIsImVudGl0eVR5cGUiOiJBV1NSRFNEQklOU1RBTkNFIn19

deep metrics:
https://one.newrelic.com/launcher/nr1-core.explorer?launcher=eyJVTlNUQUJMRV9maWx0ZXJzIjpbeyJ0eXBlIjoidGFnIiwidmFsdWUiOnsia2V5IjoiYXdzLmRiSW5zdGFuY2VJZGVudGlmaWVyIiwidmFsdWUiOiJlZ3gtdHBtLWRldi0wMSJ9fV0sInRhZ3MiOnt9LCJ0aW1lUmFuZ2UiOnsiYmVnaW5fdGltZSI6bnVsbCwiZW5kX3RpbWUiOm51bGwsImR1cmF0aW9uIjoxODAwMDAwfSwiJGlzRmFsbGJhY2tUaW1lUmFuZ2UiOnRydWV9&pane=eyJuZXJkbGV0SWQiOiJpbmZyYS1uZXJkbGV0cy5tZXRyaWNzIiwiZW50aXR5SWQiOiJNVFUxTURrMU5IeEpUa1pTUVh4T1FYdzVNRFk1TVRneE56YzRNVFE1TlRjeE1ETXkifQ==&sidebars[0]=eyJuZXJkbGV0SWQiOiJucjEtY29yZS5hY3Rpb25zIiwiZW50aXR5SWQiOiJNVFUxTURrMU5IeEpUa1pTUVh4T1FYdzVNRFk1TVRneE56YzRNVFE1TlRjeE1ETXkiLCJzZWxlY3RlZE5lcmRsZXQiOnsibmVyZGxldElkIjoiaW5mcmEtbmVyZGxldHMubWV0cmljcyJ9fQ


Corex_Flow Dynamo DB:
https://one.newrelic.com/launcher/nr1-core.explorer?launcher=eyJVTlNUQUJMRV9maWx0ZXJzIjpbeyJ0eXBlIjoiZW50aXR5VHlwZSIsInZhbHVlIjp7InR5cGUiOiJBV1NEWU5BTU9EQlRBQkxFIiwiZG9tYWluIjoiSU5GUkEifX1dLCJ0YWdzIjp7fSwidGltZVJhbmdlIjp7ImJlZ2luX3RpbWUiOm51bGwsImVuZF90aW1lIjpudWxsLCJkdXJhdGlvbiI6MTgwMDAwMH0sIiRpc0ZhbGxiYWNrVGltZVJhbmdlIjp0cnVlfQ==&pane=eyJuZXJkbGV0SWQiOiJpbmZyYS1uZXJkbGV0cy5vdmVydmlldyIsImVudGl0eUlkIjoiTVRVMU1EazFOSHhKVGtaU1FYeE9RWHc0TnpZMU56QTBPVE15TnpFek1EWXhNVGd6IiwiaXNPdmVydmlldyI6dHJ1ZX0=&sidebars[0]=eyJuZXJkbGV0SWQiOiJucjEtY29yZS5hY3Rpb25zIiwiZW50aXR5SWQiOiJNVFUxTURrMU5IeEpUa1pTUVh4T1FYdzROelkxTnpBME9UTXlOekV6TURZeE1UZ3oiLCJzZWxlY3RlZE5lcmRsZXQiOnsibmVyZGxldElkIjoiaW5mcmEtbmVyZGxldHMub3ZlcnZpZXciLCJpc092ZXJ2aWV3Ijp0cnVlfX0=


but no data

event bus 
https://one.newrelic.com/launcher/nr1-core.explorer?launcher=eyJVTlNUQUJMRV9maWx0ZXJzIjpbeyJ0eXBlIjoidGFnIiwidmFsdWUiOnsia2V5IjoibGFiZWwuc2VydmljZSIsInZhbHVlIjoiY29yZXgtbW9uZ28ifX0seyJ0eXBlIjoidGFnIiwidmFsdWUiOnsia2V5IjoiaG9zdG5hbWUiLCJ2YWx1ZSI6IkNvcmVYLVNURy1kYi1lYi1zMS0wMS5hd3Nkc2kuZ2h4LmNvbSJ9fV0sInRhZ3MiOnt9LCJ0aW1lUmFuZ2UiOnsiYmVnaW5fdGltZSI6bnVsbCwiZW5kX3RpbWUiOm51bGwsImR1cmF0aW9uIjoxODAwMDAwfSwiJGlzRmFsbGJhY2tUaW1lUmFuZ2UiOnRydWUsImFjY291bnRJZCI6MTU1MDk1NCwicXVlcnkiOiIiLCJiZWdpbiI6bnVsbCwiZW5kIjpudWxsfQ==&pane=eyJuZXJkbGV0SWQiOiJpbmZyYS1uZXJkbGV0cy5ob3N0IiwiZW50aXR5SWQiOiJNVFUxTURrMU5IeEpUa1pTUVh4T1FYdzJPRGcwTmpNd01UWXlPVEUzTlRBMU9UQXkiLCJpc092ZXJ2aWV3Ijp0cnVlfQ==&sidebars[0]=eyJuZXJkbGV0SWQiOiJucjEtY29yZS5hY3Rpb25zIiwiZW50aXR5SWQiOiJNVFUxTURrMU5IeEpUa1pTUVh4T1FYdzJPRGcwTmpNd01UWXlPVEUzTlRBMU9UQXkiLCJzZWxlY3RlZE5lcmRsZXQiOnsibmVyZGxldElkIjoiaW5mcmEtbmVyZGxldHMuaG9zdCIsImlzT3ZlcnZpZXciOnRydWV9fQ==


Avg of all:

https://infrastructure.newrelic.com/accounts/1550954/hosts/processes?entityLookupAlt=ip-10-31-60-114.awsdsi.ghx.com&timeStart=30%20minutes%20ago&filters=%7B%22and%22%3A%5B%7B%22or%22%3A%5B%7B%22like%22%3A%7B%22apmApplicationNames%22%3A%22%7CSTG-io-engine%7C%22%7D%7D%5D%7D%5D%7D

https://infrastructure.newrelic.com/accounts/1550954/hosts/system?entityLookupAlt=ip-10-31-60-114.awsdsi.ghx.com&filters=%7B%22and%22%3A%5B%7B%22or%22%3A%5B%7B%22like%22%3A%7B%22apmApplicationNames%22%3A%22%7CSTG-io-engine%7C%22%7D%7D%5D%7D%5D%7D&timeStart=30%20minutes%20ago


event bus:

https://one.newrelic.com/launcher/nr1-core.explorer?launcher=eyJVTlNUQUJMRV9maWx0ZXJzIjpbeyJ0eXBlIjoidGFnIiwidmFsdWUiOnsia2V5IjoibGFiZWwuc2VydmljZSIsInZhbHVlIjoiY29yZXgtbW9uZ28ifX0seyJ0eXBlIjoidGFnIiwidmFsdWUiOnsia2V5IjoiaG9zdG5hbWUiLCJ2YWx1ZSI6IkNvcmVYLVNURy1kYi1lYi1zMS0wMS5hd3Nkc2kuZ2h4LmNvbSJ9fV0sInRhZ3MiOnt9LCJ0aW1lUmFuZ2UiOnsiYmVnaW5fdGltZSI6bnVsbCwiZW5kX3RpbWUiOm51bGwsImR1cmF0aW9uIjoxODAwMDAwfSwiJGlzRmFsbGJhY2tUaW1lUmFuZ2UiOnRydWUsImFjY291bnRJZCI6MTU1MDk1NCwicXVlcnkiOiIiLCJiZWdpbiI6bnVsbCwiZW5kIjpudWxsfQ==&pane=eyJuZXJkbGV0SWQiOiJpbmZyYS1uZXJkbGV0cy5ob3N0IiwiZW50aXR5SWQiOiJNVFUxTURrMU5IeEpUa1pTUVh4T1FYdzJPRGcwTmpNd01UWXlPVEUzTlRBMU9UQXkiLCJpc092ZXJ2aWV3Ijp0cnVlfQ==&sidebars[0]=eyJuZXJkbGV0SWQiOiJucjEtY29yZS5hY3Rpb25zIiwiZW50aXR5SWQiOiJNVFUxTURrMU5IeEpUa1pTUVh4T1FYdzJPRGcwTmpNd01UWXlPVEUzTlRBMU9UQXkiLCJzZWxlY3RlZE5lcmRsZXQiOnsibmVyZGxldElkIjoiaW5mcmEtbmVyZGxldHMuaG9zdCIsImlzT3ZlcnZpZXciOnRydWV9fQ==


event state :ec2 state?
heartbeat and sequence generation we use dynamodb

CloudWatch DynamoDB
https://us-west-2.console.aws.amazon.com/cloudwatch/home?region=us-west-2#cw:dashboard=DynamoDB

Corex Dev AF ES:
Instance:  i-0220cd89cd63b24a8 (CoreX-DEV-AFBT-ES-master)Private IP: 10.31.33.240
CoreX-STG-AF-ES-master)

https://one.newrelic.com/launcher/nr1-core.explorer?launcher=eyJVTlNUQUJMRV9maWx0ZXJzIjpbeyJ0eXBlIjoidGFnIiwidmFsdWUiOnsia2V5IjoibGFiZWwuTmFtZSIsInZhbHVlIjoiQ29yZVgtU1RHLUFGLUVTLW1hc3RlciJ9fV0sInRhZ3MiOnt9fQ==&pane=eyJuZXJkbGV0SWQiOiJucjEtY29yZS5saXN0aW5nIiwiZW50aXR5RG9tYWluIjoiSU5GUkEiLCJlbnRpdHlUeXBlIjoiSE9TVCJ9&sidebars[0]=eyJuZXJkbGV0SWQiOiJucjEtY29yZS5jYXRlZ29yaWVzIiwic2VsZWN0ZWRDYXRlZ29yeSI6eyJlbnRpdHlEb21haW4iOiJJTkZSQSIsImVudGl0eVR5cGUiOiJIT1NUIn19
CoreX-STG-BT-ES-master
corex-es.awsprd.ghx.com
DEV:
audit ,bt, PE,DP,JObs,IO

STG:


base pages:
https://insights.newrelic.com/apps/accounts/1550954/corex


egx-tpm-dev-01

https://one.newrelic.com/launcher/nr1-core.explorer?launcher=eyJVTlNUQUJMRV9maWx0ZXJzIjpbeyJ0eXBlIjoidGFnIiwidmFsdWUiOnsia2V5IjoiYXdzLmRiSW5zdGFuY2VJZGVudGlmaWVyIiwidmFsdWUiOiJlZ3gtdHBtLWRldi0wMSJ9fV0sInRhZ3MiOnt9LCJ0aW1lUmFuZ2UiOnsiYmVnaW5fdGltZSI6bnVsbCwiZW5kX3RpbWUiOm51bGwsImR1cmF0aW9uIjoxODAwMDAwfSwiJGlzRmFsbGJhY2tUaW1lUmFuZ2UiOnRydWV9&pane=eyJuZXJkbGV0SWQiOiJpbmZyYS1uZXJkbGV0cy5vdmVydmlldyIsImlzT3ZlcnZpZXciOnRydWUsImVudGl0eUlkIjoiTVRVMU1EazFOSHhKVGtaU1FYeE9RWHc1TURZNU1UZ3hOemM0TVRRNU5UY3hNRE15In0=&sidebars[0]=eyJuZXJkbGV0SWQiOiJucjEtY29yZS5hY3Rpb25zIiwiZW50aXR5SWQiOiJNVFUxTURrMU5IeEpUa1pTUVh4T1FYdzVNRFk1TVRneE56YzRNVFE1TlRjeE1ETXkiLCJzZWxlY3RlZE5lcmRsZXQiOnsibmVyZGxldElkIjoiaW5mcmEtbmVyZGxldHMub3ZlcnZpZXciLCJpc092ZXJ2aWV3Ijp0cnVlfX0=


7049)&#x29;
2021-06-23 22:42:14,733 |DEBUG [https-jsse-nio-8443-exec-137] c.g.t.a.d.EBExecutionRunTimeBusinessStatisticsDAO - ebExecutionRunTimeBusinessStatisticsAggregation.Inside DAO AggTime&#x3a;[]
2021-06-23 22:42:14,733 |DEBUG [https-jsse-nio-8443-exec-137] c.g.t.a.d.EBExecutionRunTimeBusinessStatisticsDAO - engineName&#x3a;Engine-IO,name&#x3a;bus.publish.events.per.hour,fromDate&#x3a;2021-06-24 04:34:07.584,toDate&#x3a;2021-06-24 04:42:12.195
2021-06-23 22:42:15,835 |DEBUG [https-jsse-nio-8443-exec-137] c.g.t.a.d.EBExecutionRunTimeBusinessStatisticsDAO - ebExecutionRunTimeBusinessStatisticsAggregation.Inside DAO AggTime&#x3a;[]
2021-06-23 22:42:15,836 |DEBUG [https-jsse-nio-8443-exec-137] c.g.t.a.d.EBExecutionRunTimeBusinessStatisticsDAO - engineName&#x3a;Engine-PE,name&#x3a;bus.publish.events.per.second,fromDate&#x3a;2021-06-24 04:34:07.584,toDate&#x3a;2021-06-24 04:42:12.195


createQuery().field(ENGINENAME).equalIgnoreCase(engineName).field("componentId")
.equal("eventbus").field("name").equal(name).field("type").equal("NUMERIC").field(TIME)
.greaterThanOrEq(Timestamp.valueOf(fromDate)).field(TIME)
.lessThanOrEq(Timestamp.valueOf(toDate))

db.getCollection('EBExecutionRunTimeBusinessStatistics').find({"engineName":"ENGINE-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":$gte{Timestamp.valueOf("2021-06-24 04:34:07.584")}},"time":$lte{(Timestamp.valueOf("2021-06-24 04:42:12.195")}}})

.group(Group.id(grouping("month", new Accumulator("$month", TIME)),
grouping("day", new Accumulator("$dayOfMonth", TIME)),
grouping("year", new Accumulator("$year", TIME)),
grouping("hour", new Accumulator("$hour", TIME)),
grouping("minutes", new Accumulator("$minute", TIME)), grouping(ENGINENAME, ENGINENAME)),
grouping("totalValue", new Accumulator("$sum", "value")))

$group :
  {"Month" : "$date.month", 
}


.project(projection("month", "_id.month"), projection("day", "_id.day"), projection("year", "_id.year"),
projection("hour", "_id.hour"), projection("minutes", "_id.minutes"),
projection("engineName", "_id.engineName"), projection("totalValue", "totalValue"))


"$project" : {
                "date" : {
                    "$dateFromString" : {
                        "dateString" : "$createdAt", 
                        "onError" : "$date"
                    }
                }, 



{$project : { 
          month : {$month : "_id.month"}, 
          year : {$day :  "_id.day"},

      }},



db.getCollection('EBExecutionRunTimeBusinessStatistics').find({"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195")}}).aggregate({ "$group" : {"_id": {"year" : { "$year" : "time" }, "month" : { "$month" : "time" },"day" : { "$dayOfMonth" : "time" }}}});





{ $match : {"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195") } }


db.EBExecutionRunTimeBusinessStatisticsAgg.aggregate([{ $match : {"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195") } },{"$group" : {"_id": {"month":{ "$month":"time"}}}}]);


db.EBExecutionRunTimeBusinessStatisticsAgg.aggregate([{ $match : {"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195") }}}])



db.EBExecutionRunTimeBusinessStatistics.aggregate([{ $match : {"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195") }}},{"$group":{"_id":{"month":{"$month": "$time"},"day":{"$dayOfMonth":"$time"},"year":{"$year":"$time"},"hour":{"$hour":"$time"},"minutes":{"$minute":"$time"},"totalValue":{"$sum":"$value"}}}}])



db.EBExecutionRunTimeBusinessStatistics.aggregate([
{
   "$match":{
      "engineName":"Engine-PE",
      "componentId":"eventbus",
      "name":"bus.publish.events.per.hour",
      "type":"NUMERIC",
      "time":{
         "$gte":"ISODate(""2021-06-24 04:34:07.584"")",
         "$lte":"ISODate(""2021-06-24 04:42:12.195"")"
      }
   }
},
{
   "$group":{
      "_id":{
         "month":{
            "$month":"$time"
         },
         "day":{
            "$dayOfMonth":"$time"
         },
         "year":{
            "$year":"$time"
         },
         "hour":{
            "$hour":"$time"
         },
         "minutes":{
            "$minute":"$time"
         },
         "totalValue":{
            "$sum":"$value"
         }
      }
   }
}
,
{
"$project":{
"month": "_id.month"
}])



db.EBExecutionRunTimeBusinessStatistics.aggregate([{ $match : {"engineName":"Engine-PE","componentId":"eventbus","name":"bus.publish.events.per.hour","type":"NUMERIC","time":{"$gte":ISODate("2021-06-24 04:34:07.584"),"$lte":ISODate("2021-06-24 04:42:12.195") }}},{"$group":{"_id":{"month":{"$month": "$time"},"day":{"$dayOfMonth":"$time"},"year":{"$year":"$time"},"hour":{"$hour":"$time"},"minutes":{"$minute":"$time"},"totalValue":{"$sum":"$value"}}}},{"$project":{"month": "_id.month","day", "_id.day","year", "_id.year","hour", "_id.hour","minutes", "_id.minutes","engineName", "_id.engineName","totalValue", "totalValue"}}])


>>>project[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}]

db.getCollection('TestResult').aggregate([{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}])


>>>sort[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}]

db.getCollection('TestResult').aggregate([{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}]);

>>>skip[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}]


>>>limit[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}]

db.getCollection('TestResult').aggregate([{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}])


 org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/json-io-2.6.0.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/rsyntaxtextarea-2.6.1.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/cron-utils-8.0.0.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/tagsoup-1.2.1.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/byte-buddy-1.10.21.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/woden-api-1.0M8.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/aggs-matrix-stats-client-7.4.2.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/local-cache-scheduler-1.1.2.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/stats-engine-2.6.0-SNAPSHOT.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/spring-data-commons-1.10.0.RELEASE.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/jakarta.activation-api-1.2.1.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/ews-2.6.0-SNAPSHOT.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/commons-email-1.5.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/tracked-config-impl-2.1.0.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/aspectjweaver-1.8.7.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/datapoller-2.6.0-SNAPSHOT.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/apache-mime4j-core-0.7.2.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache getResource
WARNING: Unable to add the resource at [/WEB-INF/lib/sms-proxied-3.6.0.jar] to the cache because there was insufficient free space available after evicting expired cache entries - consider increasing the maximum size of the cache
Aug 02, 2021 11:28:48 PM org.apache.catalina.webresources.Cache backgroundProcess
INFO: The background cache eviction process was unable to free [10] percent of the cache for Context [/ui-heimdall] - consider increasing the maximum size of the cache. After eviction approximately [10,239] KB of data remained in the cache.
2021-08-02 23:28:50,300 |INFO [http-nio-8080-exec-1] com.ghx.web.filter.security.CRLFFilter - Url &#x3a; 
2021-08-02 23:28:50,300 |INFO [http-nio-8080-exec-1] com.ghx.web.filter.security.CRLFFilter - CRLF enabled true
2021-08-02 23:28:50,300 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - user spkannan (id=1700) attempt to access com.ghx.tpm.rest.system.monitoring.SystemStatusRESTService.stoppedAndThrottled&#x28;[]&#x29;
2021-08-02 23:28:50,301 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - user spkannan (id=1700) attempt to access com.ghx.tpm.rest.system.monitoring.cache.ComponentAndAdapterStatusMonitoringConfigCacheImpl.getCacheNameKey&#x28;[]&#x29;
2021-08-02 23:28:50,301 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - Access to com.ghx.tpm.rest.system.monitoring.cache.ComponentAndAdapterStatusMonitoringConfigCacheImpl granted to getCacheNameKey.[]&#x28;user spkannan (id=1700)&#x29;
2021-08-02 23:28:50,301 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - user spkannan (id=1700) attempt to access com.ghx.tpm.rest.system.monitoring.cache.ComponentAndAdapterStatusMonitoringConfigCacheImpl.get&#x28;[componentAndAdapterStatusCache, com.ghx.tpm.rest.system.monitoring.SystemStatusRESTService$$Lambda$1654/0x00000001020cf040@3c865021]&#x29;
2021-08-02 23:28:50,303 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - user spkannan (id=1700) attempt to access com.ghx.tpm.rest.system.monitoring.ComponentAdapterReportingServiceImpl.getCurrentComponentAndAdapterStatusReport&#x28;[com.ghx.system.monitoring.model.dto.StoppedListenersDto@4cbc775d]&#x29;
2021-08-02 23:28:50,303 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - Access to com.ghx.tpm.rest.system.monitoring.ComponentAdapterReportingServiceImpl granted to getCurrentComponentAndAdapterStatusReport.[com.ghx.system.monitoring.model.dto.StoppedListenersDto@4cbc775d]&#x28;user spkannan (id=1700)&#x29;
2021-08-02 23:28:50,303 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - Access to com.ghx.tpm.rest.system.monitoring.cache.ComponentAndAdapterStatusMonitoringConfigCacheImpl granted to get.[componentAndAdapterStatusCache, com.ghx.tpm.rest.system.monitoring.SystemStatusRESTService$$Lambda$1654/0x00000001020cf040@3c865021]&#x28;user spkannan (id=1700)&#x29;
2021-08-02 23:28:50,303 |INFO [http-nio-8080-exec-1] com.ghx.tpm.GHXTpmSecurityAspect - Access to com.ghx.tpm.rest.system.monitoring.SystemStatusRESTService granted to stoppedAndThrottled.[]&#x28;user spkannan (id=1700)&#x29;
2021-08-02 23:28:51,815 |WARN [EGXLocal-EVENT_BUS_SCHEDULER_Worker-7] com.ghx.eb.impl.rebalance.ListenerRebalancer - LISTENER_REBALANCER CACHE - Null or empty map returned from listenerStatusService.retrieveAll&#x28;UserName_sys-user_98353&#x29;
2021-08-02 23:28:51,815 |INFO [EGXLocal-EVENT_BUS_SCHEDULER_Worker-7] com.ghx.eb.impl.rebalance.ListenerRebalancer - 
Listener CACHE:Local :
>>>limit[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion", "updated.on": "$updated.on"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}]
2021-08-02 23:28:56,817 |WARN [EGXLocal-EVENT_BUS_SCHEDULER_Worker-9] com.ghx.eb.impl.rebalance.ListenerRebalancer - LISTENER_REBALANCER CACHE - Null or empty map returned from listenerStatusService.retrieveAll&#x28;UserName_sys-user_98353&#x29;
2021-08-02 23:28:56,817 |INFO [EGXLocal-EVENT_BUS_SCHEDULER_Worker-9] com.ghx.eb.impl.rebalance.ListenerRebalancer - 
Listener CACHE:Local :
2021-08-02 23:28:57,463 |ERROR [http-nio-8080-exec-5] c.g.w.exception.ExceptionToHTTPStatusResolver - Resolving exception
com.mongodb.MongoCommandException: Command failed with error 16412 (Location16412): 'FieldPath field names may not contain '.'.' on server localhost:27017. The full response is {"ok": 0.0, "errmsg": "FieldPath field names may not contain '.'.", "code": 16412, "codeName": "Location16412"}
at com.mongodb.internal.connection.ProtocolHelper.getCommandFailureException(ProtocolHelper.java:175) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.receiveCommandMessageResponse(InternalStreamConnection.java:303) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.InternalStreamConnection.sendAndReceive(InternalStreamConnection.java:259) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.UsageTrackingInternalConnection.sendAndReceive(UsageTrackingInternalConnection.java:99) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.DefaultConnectionPool$PooledConnection.sendAndReceive(DefaultConnectionPool.java:450) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.CommandProtocolImpl.execute(CommandProtocolImpl.java:72) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.DefaultServer$DefaultServerProtocolExecutor.execute(DefaultServer.java:218) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.DefaultServerConnection.executeProtocol(DefaultServerConnection.java:269) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:131) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.internal.connection.DefaultServerConnection.command(DefaultServerConnection.java:123) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.CommandOperationHelper.executeCommand(CommandOperationHelper.java:343) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.CommandOperationHelper.executeCommand(CommandOperationHelper.java:334) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.CommandOperationHelper.executeCommandWithConnection(CommandOperationHelper.java:220) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.CommandOperationHelper$5.call(CommandOperationHelper.java:206) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.OperationHelper.withReadConnectionSource(OperationHelper.java:463) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.CommandOperationHelper.executeCommand(CommandOperationHelper.java:203) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.AggregateOperationImpl.execute(AggregateOperationImpl.java:200) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.AggregateOperation.execute(AggregateOperation.java:333) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.operation.AggregateOperation.execute(AggregateOperation.java:42) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:189) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java:170) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.DBCollection.aggregate(DBCollection.java:1530) ~[mongo-java-driver-3.11.2.jar:na]
at com.mongodb.DBCollection.aggregate(DBCollection.java:1488) ~[mongo-java-driver-3.11.2.jar:na]
at dev.morphia.aggregation.AggregationPipelineImpl.aggregate(AggregationPipelineImpl.java:84) ~[core-1.5.3.jar:na]
at dev.morphia.aggregation.AggregationPipelineImpl.aggregate(AggregationPipelineImpl.java:75) ~[core-1.5.3.jar:na]
at dev.morphia.aggregation.AggregationPipelineImpl.aggregate(AggregationPipelineImpl.java:64) ~[core-1.5.3.jar:na]
at com.ghx.testframework.api.dao.TestResultDAO.getReleaseVersions(TestResultDAO.java:546) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at com.ghx.testframework.api.service.impl.TestResultServiceImpl.getReleaseVersions(TestResultServiceImpl.java:1233) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at com.ghx.testframework.api.rest.TestResultRESTService.getReleaseVersions(TestResultRESTService.java:371) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at com.ghx.testframework.api.rest.TestResultRESTService$$FastClassBySpringCGLIB$$216c3552.invoke(<generated>) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:100) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at com.ghx.access.control.core.authorization.SecurityAnnotationProcessor.applySecurity(SecurityAnnotationProcessor.java:130) ~[security-commons-2.6.0-SNAPSHOT.jar:na]
at com.ghx.access.control.core.authorization.SecurityAnnotationProcessor.process(SecurityAnnotationProcessor.java:98) ~[security-commons-2.6.0-SNAPSHOT.jar:na]
at com.ghx.access.control.BaseSecurityAspect.doProcessAccessControl(BaseSecurityAspect.java:88) ~[security-commons-2.6.0-SNAPSHOT.jar:na]
at com.ghx.access.control.BaseSecurityAspect.doProcessAccessControl(BaseSecurityAspect.java:77) ~[security-commons-2.6.0-SNAPSHOT.jar:na]
at com.ghx.heimdall.service.GHXHeimdallSecurityAspect.doProcessAccessControl(GHXHeimdallSecurityAspect.java:43) ~[rest-heimdall-2.6.0-SNAPSHOT.jar:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) ~[spring-security-core-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at com.ghx.testframework.api.rest.TestResultRESTService$$EnhancerBySpringCGLIB$$14812954.getReleaseVersions(<generated>) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at com.ghx.testframework.api.rest.TestResultRESTService$$FastClassBySpringCGLIB$$216c3552.invoke(<generated>) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218) ~[spring-core-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:746) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.security.access.intercept.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:64) ~[spring-security-core-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688) ~[spring-aop-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at com.ghx.testframework.api.rest.TestResultRESTService$$EnhancerBySpringCGLIB$$a3da246a.getReleaseVersions(<generated>) ~[test-framework-api-2.6.0-SNAPSHOT.jar:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:na]
at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[na:na]
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:207) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:137) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:102) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:895) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:800) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1038) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:998) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:890) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:622) ~[servlet-api.jar:na]
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:875) ~[spring-webmvc-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729) ~[servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:230) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) ~[tomcat-websocket.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at com.ghx.web.filter.SessionTimeoutTrackingFilter.doFilter(SessionTimeoutTrackingFilter.java:63) ~[classes/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.springframework.orm.hibernate5.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:155) ~[spring-orm-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:330) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at com.ghx.web.filter.ProductHandleURLFilter.doFilter(ProductHandleURLFilter.java:55) ~[classes/:na]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at com.ghx.web.filter.security.CRLFFilter.doFilter(CRLFFilter.java:77) ~[classes/:na]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:118) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:84) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:113) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:103) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:113) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:154) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:45) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.doFilter(BasicAuthenticationFilter.java:150) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.authentication.AbstractAuthenticationProcessingFilter.doFilter(AbstractAuthenticationProcessingFilter.java:199) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.authentication.logout.LogoutFilter.doFilter(LogoutFilter.java:110) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:50) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at com.ghx.security.web.filter.CorsFilter.doFilterInternal(CorsFilter.java:48) ~[security-commons-2.6.0-SNAPSHOT.jar:na]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:87) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at com.ghx.web.filter.ExpiredSessionFilter.doFilter(ExpiredSessionFilter.java:97) ~[classes/:na]
at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:342) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:192) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:160) ~[spring-security-web-3.2.5.RELEASE.jar:3.2.5.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:120) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.1.RELEASE.jar:5.1.1.RELEASE]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at com.ghx.web.filter.IECompatibilityFilter.doFilter(IECompatibilityFilter.java:23) ~[classes/:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:192) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:165) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:198) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:108) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:140) ~[catalina.jar:8.5.0]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:79) ~[catalina.jar:8.5.0]
at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:620) ~[catalina.jar:8.5.0]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:87) ~[catalina.jar:8.5.0]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[catalina.jar:8.5.0]
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:1096) ~[tomcat-coyote.jar:8.5.0]
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-coyote.jar:8.5.0]
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:760) ~[tomcat-coyote.jar:8.5.0]
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1480) ~[tomcat-coyote.jar:8.5.0]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[na:na]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[na:na]
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-util.jar:8.5.0]
at java.base/java.lang.Thread.run(Thread.java:829) ~[na:na]


>>>limit[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion", "updated": "$updated"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}]


>>>limit[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion", "updated": "$updated"}, "unique_release": {"$addToSet": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"unique_release": "$unique_release", "releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}]



>>>limit[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion", "updated": "$updated"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}]


>>>limit[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion", "updated": "$updated"}, "unique_release": {"$addToSet": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"unique_release": "$unique_release", "releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}]

>>>project[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}]

db.getCollection('TestResult').aggregate([{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}])


>>>sort[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}]

db.getCollection('TestResult').aggregate([{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}]);

>>>skip[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}]


>>>limit[{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}]

db.getCollection('TestResult').aggregate([{"$match": {"runStatus": {"$regex": "^\\QCompleted\\E$", "$options": "i"}, "releaseVersion": {"$exists": true}}}, {"$group": {"_id": {"releaseVersion": "$releaseVersion"}, "count": {"$sum": 1}}}, {"$project": {"releaseVersion": "$_id.releaseVersion", "updated.on": "$_id.updated.on"}}, {"$sort": {"_id.updated.on": -1}}, {"$skip": 0}, {"$limit": 10}])


#!/usr/bin/env python3.8
'''import json
import base64
import requests as req
user = 'bamboouser'
passwd = 'P@nd@F00d'

pwd =  "Basic " + base64.b64encode(b'spkannan:P@nd@F00d').decode(" US-ASCII") 
resp = req.get("https://workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query=CXTF-",headers = {'content-type': 'application/json', 'accept': 'application/json'},auth=(user,passwd))
print(resp)
if resp.status_code == 200:
    response_json = resp.json()
    print(response_json)'''


'''import json

import requests as req
user = 'spkannan'
passwd = 'Corex@tfw123'
resp = req.get("https://workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework &showSubTasks=true&showSubTaskParent=true&appId=&query=CXTF-22", auth=(user, passwd))
print(resp)
if resp.status_code == 200:
    response_json = resp.json()
    sections = response_json['sections'][0]
    for issue in sections['issues']:
       print(issue['key'])'''
#!/usr/bin/env python3
import json

import requests as req
user = 'spkannan'
passwd = 'Corex@tfw123'

'''resp = req.get("https://workflow.ghx.com/rest/api/2/search?jql=project=CXTF",headers = {'Content-Type' : 'application/json'}, auth=(user, passwd))'''
resp = req.get("https://workflow.ghx.com/rest/api/2/issue/picker?currentJQL=project=CoreX Test Framework AND issuekeyE-2242&currentIssueKey=CXTF-1978&showSubTasks=true&showSubTaskParent=true&appId=&query=CXTF-22&_=1634745724544", auth=(user, passwd))
print(resp.status_code)
if resp.status_code == 200:
    response_json = resp.json()
    sections = response_json['sections'][0]
for issue in sections['issues']:
    print(issue['key'])


NodeJs
------
https://drive.google.com/file/d/1JuvpxujH1LhzvLeMnXx23EC39IHZ1WGq/view?usp=sharing
https://drive.google.com/file/d/1Qr_J-OgwG29MfbDYiCKpbJ2Xpev9U24M/view?usp=sharing
https://drive.google.com/file/d/1oPTR9dtSJM8ypisK2cFp6uBTm_1Q9DIa/view?usp=sharing

React
-------
https://drive.google.com/file/d/1dm6oq_sZa8LfEQMnjbXWsmIDzEef6Jft/view?usp=sharing
https://drive.google.com/file/d/1lreq2SVTIxpI4KhgvjGMzZd_UFRDdUd_/view?usp=sharing
https://drive.google.com/file/d/1vjn9VMlEX9uSJ0QkD4ZGQ2TMl8v5W4Iu/view?usp=sharing
https://drive.google.com/file/d/1cNfhwJ_VCvasJbOx6bb53LMKs8hyg_dD/view?usp=sharing


mongo

https://drive.google.com/file/d/1h5wPxBXNIAFjr_l8iegP6UkPL5UFv5fE/view?usp=sharing
https://drive.google.com/file/d/1mkq5Pj2bOKwaSJ-ELrVaaUMroGeBeCsb/view?usp=sharing
https://drive.google.com/file/d/1wjjDlYls0ZWYlKWVpXZuLs4AMjZ9wKH_/view?usp=sharing
https://drive.google.com/file/d/1rnjIS2PhTcFr-ln8WXNCe1E_fQ1Jwv0I/view?usp=sharing
https://drive.google.com/file/d/1YTmYydpgTA_clrYpiAJEzblBrD8RbnLd/view?usp=sharing
https://drive.google.com/file/d/1Swf_7CM7vMFQtgtdPk1vdUSiSAwsxjgX/view?usp=sharing
https://drive.google.com/file/d/1qofPlO44T2y_jq3iikBG5iPbvY86H1-G/view?usp=sharing


microservice

https://meet.google.com/mse-ttxx-nxz
07.05.2020 Day 3 - Recorded Video URL https://drive.google.com/drive/folders/0BzU2HFaR9oV5fkd6QThwSGN4MHlpX1RaQ2tsRzUxcVBUb0s5d2JvQmsxN29XdmE2a0RHMEk?usp=sharing
https://drive.google.com/drive/folders/0BzU2HFaR9oV5fkd6QThwSGN4MHlpX1RaQ2tsRzUxcVBUb0s5d2JvQmsxN29XdmE2a0RHMEk?usp=sharing
Sabarinathan, 17:44
Micoservice Development Setup
1. Install Jhipster - https://www.jhipster.tech/configuring-ide/
2. Please walk through the  JDL - https://www.jhipster.tech/jdl/applications
3. Design the JDL for your application.

https://www.jhipster.tech/configuring-ide/

https://www.jhipster.tech/jdl/applications

Sivakumar Ji, JHipster -> Java Hipster -> So, we should use other frameworks like Django for python which does limited for web app development.
JHipster Application Generator builds (frameworks it support)
https://www.jhipster.tech/modules/official-blueprints/

https://drive.google.com/open?id=1vvO5w9mkhWAjgBmkhedHWWo5anp_mVr5

All recordings

https://drive.google.com/open?id=1vvO5w9mkhWAjgBmkhedHWWo5anp_mVr5

Please find the jdl file, Which have used in the session.

run command - where you want to generate the applications
> jhipster import-jdl <location>/ecommerce.jdl

https://docs.docker.com/get-docker/
https://drive.google.com/file/d/1S8HvoKDFsHIkhmt7MAxXYpTAybo7mQOi/view

https://drive.google.com/file/d/1_bEbdE3vi-EvC9KyQe65_GhD6tRHmEm2/view?usp=sharing

https://drive.google.com/file/d/1_bEbdE3vi-EvC9KyQe65_GhD6tRHmEm2/view

https://drive.google.com/file/d/1KZsr7gZjrm9PwlBadmCujC9eIfHgeCpm/view?usp=drivesdk

https://drive.google.com/file/d/1NgRK5qydWeFdNG6rkr9NBEpxOpjOlkVw/view

https://drive.google.com/folderview?id=1vvO5w9mkhWAjgBmkhedHWWo5anp_mVr5

http://128.199.223.27/smi-training/microservices-training-batch-1

Copy SSH clone URL
git@128.199.223.27:smi-training/microservices-training-batch-1.git

http://128.199.223.27/smi-training/microservices-training-batch-1.git

http://128.199.223.27/smi-training/microservices-training-batch-1.git

https://drive.google.com/folderview?id=1vvO5w9mkhWAjgBmkhedHWWo5anp_mVr5

https://drive.google.com/drive/folders/1vvO5w9mkhWAjgBmkhedHWWo5anp_mVr5?usp=sharing

















Comments