Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dashboard and controllerInformation #4

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
target/
class_diagram.ucls
.idea
.iml
58 changes: 58 additions & 0 deletions aws-cloudwatch-exts-commons.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<?xml version="1.0" encoding="UTF-8"?>
<module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule="true" type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_8">
<output url="file://$MODULE_DIR$/target/classes" />
<output-test url="file://$MODULE_DIR$/target/test-classes" />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/main/resources" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/resources" type="java-test-resource" />
<excludeFolder url="file://$MODULE_DIR$/target" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
<orderEntry type="library" scope="PROVIDED" name="Maven: com.appdynamics:machine-agent:3.7.11" level="project" />
<orderEntry type="library" scope="PROVIDED" name="Maven: log4j:log4j:1.2.17" level="project" />
<orderEntry type="library" name="Maven: commons-io:commons-io:2.4" level="project" />
<orderEntry type="library" name="Maven: commons-codec:commons-codec:1.9" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-log4j12:1.7.21" level="project" />
<orderEntry type="library" name="Maven: org.slf4j:slf4j-api:1.7.21" level="project" />
<orderEntry type="module" module-name="appd-exts-commons" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-core-asl:1.9.13" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.jackson:jackson-mapper-asl:1.9.13" level="project" />
<orderEntry type="library" name="Maven: commons-httpclient:commons-httpclient:3.1" level="project" />
<orderEntry type="library" name="Maven: commons-logging:commons-logging:1.0.4" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpclient:4.5.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpcore:4.4.10" level="project" />
<orderEntry type="library" name="Maven: org.apache.httpcomponents:httpmime:4.5.6" level="project" />
<orderEntry type="library" name="Maven: org.apache.commons:commons-lang3:3.8" level="project" />
<orderEntry type="library" name="Maven: org.nanohttpd:nanohttpd:2.3.0" level="project" />
<orderEntry type="library" name="Maven: org.yaml:snakeyaml:1.13" level="project" />
<orderEntry type="library" name="Maven: net.objecthunter:exp4j:0.4.8" level="project" />
<orderEntry type="library" name="Maven: org.unix4j:unix4j-command:0.4" level="project" />
<orderEntry type="library" name="Maven: org.unix4j:unix4j-base:0.4" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.woodstox:woodstox-core:5.0.2" level="project" />
<orderEntry type="library" name="Maven: org.codehaus.woodstox:stax2-api:3.1.4" level="project" />
<orderEntry type="library" name="Maven: com.google.guava:guava:19.0" level="project" />
<orderEntry type="library" name="Maven: com.google.code.gson:gson:2.8.2" level="project" />
<orderEntry type="library" name="Maven: joda-time:joda-time:2.3" level="project" />
<orderEntry type="library" name="Maven: commons-lang:commons-lang:2.6" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-cloudwatch:1.10.0" level="project" />
<orderEntry type="library" name="Maven: com.amazonaws:aws-java-sdk-core:1.10.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-databind:2.5.3" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-annotations:2.5.0" level="project" />
<orderEntry type="library" name="Maven: com.fasterxml.jackson.core:jackson-core:2.5.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: junit:junit:4.11" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.hamcrest:hamcrest-core:1.3" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-mockito:1.4.7" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.mockito:mockito-all:1.8.5" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-api-support:1.4.7" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-core:1.4.7" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.javassist:javassist:3.14.0-GA" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-reflect:1.4.7" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.objenesis:objenesis:1.2" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4:1.4.7" level="project" />
<orderEntry type="library" scope="TEST" name="Maven: org.powermock:powermock-module-junit4-common:1.4.7" level="project" />
</component>
</module>
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>com.appdynamics.extensions</groupId>
<artifactId>aws-cloudwatch-exts-commons</artifactId>
<version>2.0.1</version>
<version>2.0.2</version>
<packaging>jar</packaging>

<name>aws-cloudwatch-exts-commons</name>
Expand Down Expand Up @@ -43,7 +43,7 @@
<dependency>
<groupId>com.appdynamics</groupId>
<artifactId>appd-exts-commons</artifactId>
<version>2.1.0</version>
<version>2.1.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.woodstox</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@

package com.appdynamics.extensions.aws.collectors;

import static com.appdynamics.extensions.aws.Constants.DEFAULT_MAX_ERROR_RETRY;
import static com.appdynamics.extensions.aws.Constants.DEFAULT_NO_OF_THREADS;
import static com.appdynamics.extensions.aws.util.AWSUtil.createAWSClientConfiguration;
import static com.appdynamics.extensions.aws.util.AWSUtil.createAWSCredentials;
import static com.appdynamics.extensions.aws.validators.Validator.validateAccount;

import com.amazonaws.ClientConfiguration;
import com.amazonaws.auth.AWSCredentials;
import com.appdynamics.extensions.MonitorExecutorService;
Expand All @@ -32,14 +26,15 @@

import java.util.List;
import java.util.Set;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.*;
import java.util.concurrent.atomic.LongAdder;

import static com.appdynamics.extensions.aws.Constants.DEFAULT_MAX_ERROR_RETRY;
import static com.appdynamics.extensions.aws.Constants.DEFAULT_NO_OF_THREADS;
import static com.appdynamics.extensions.aws.util.AWSUtil.createAWSClientConfiguration;
import static com.appdynamics.extensions.aws.util.AWSUtil.createAWSCredentials;
import static com.appdynamics.extensions.aws.validators.Validator.validateAccount;

/**
* Collects statistics (of specified regions) for specified account
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,9 @@

package com.appdynamics.extensions.aws.collectors;

import static com.appdynamics.extensions.aws.Constants.DEFAULT_NO_OF_THREADS;
import static com.appdynamics.extensions.aws.validators.Validator.validateNamespace;

import com.appdynamics.extensions.MonitorExecutorService;
import com.appdynamics.extensions.MonitorThreadPoolExecutor;
import com.appdynamics.extensions.aws.config.Account;
import com.appdynamics.extensions.aws.config.ConcurrencyConfig;
import com.appdynamics.extensions.aws.config.CredentialsDecryptionConfig;
import com.appdynamics.extensions.aws.config.MetricsConfig;
import com.appdynamics.extensions.aws.config.ProxyConfig;
import com.appdynamics.extensions.aws.config.*;
import com.appdynamics.extensions.aws.exceptions.AwsException;
import com.appdynamics.extensions.aws.metric.AccountMetricStatistics;
import com.appdynamics.extensions.aws.metric.NamespaceMetricStatistics;
Expand All @@ -29,16 +22,12 @@

import java.util.List;
import java.util.Map;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;
import java.util.concurrent.*;
import java.util.concurrent.atomic.LongAdder;

import static com.appdynamics.extensions.aws.Constants.DEFAULT_NO_OF_THREADS;
import static com.appdynamics.extensions.aws.validators.Validator.validateNamespace;

/**
* Collects statistics (of all specified accounts) for specified namespace
*
Expand All @@ -63,6 +52,8 @@ public class NamespaceMetricStatisticsCollector implements Callable<List<Metric>
private LongAdder awsRequestsCounter = new LongAdder();

private String metricPrefix;
private DashboardConfig dashboardConfig;
private ControllerInformation controllerInformation;

private NamespaceMetricStatisticsCollector(Builder builder) {
this.accounts = builder.accounts;
Expand All @@ -72,6 +63,8 @@ private NamespaceMetricStatisticsCollector(Builder builder) {
this.credentialsDecryptionConfig = builder.credentialsDecryptionConfig;
this.proxyConfig = builder.proxyConfig;
this.metricPrefix = builder.metricPrefix;
this.dashboardConfig = builder.dashboardConfig;
this.controllerInformation = builder.controllerInfo;
}

/**
Expand Down Expand Up @@ -198,16 +191,20 @@ public static class Builder {
private CredentialsDecryptionConfig credentialsDecryptionConfig;
private ProxyConfig proxyConfig;
private String metricPrefix;
private DashboardConfig dashboardConfig;
private ControllerInformation controllerInfo;

public Builder(List<Account> accounts,
ConcurrencyConfig concurrencyConfig,
MetricsConfig metricsConfig,
MetricsProcessor metricsProcessor, String metricPrefix) {
MetricsProcessor metricsProcessor, String metricPrefix, DashboardConfig dashboardConfig, ControllerInformation controllerInformation) {
this.accounts = accounts;
this.concurrencyConfig = concurrencyConfig;
this.metricsConfig = metricsConfig;
this.metricsProcessor = metricsProcessor;
this.metricPrefix = metricPrefix;
this.dashboardConfig = dashboardConfig;
this.controllerInfo = controllerInformation;
}

public Builder withCredentialsDecryptionConfig(CredentialsDecryptionConfig credentialsDecryptionConfig) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,26 @@ public class Configuration {

private List<Dimension> dimensions;

private ControllerInformation controllerInfo;

private DashboardConfig customDashboard;

public DashboardConfig getCustomDashboard() {
return customDashboard;
}

public void setCustomDashboard(DashboardConfig dashboardConfig) {
this.customDashboard = dashboardConfig;
}

public ControllerInformation getControllerInfo() {
return controllerInfo;
}

public void setControllerInfo(ControllerInformation controllerInformation) {
this.controllerInfo = controllerInformation;
}

public List<Account> getAccounts() {
return accounts;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
/*
* Copyright 2018 . AppDynamics LLC and its affiliates.
* All Rights Reserved.
* This is unpublished proprietary source code of AppDynamics LLC and its affiliates.
* The copyright notice above does not evidence any actual or intended publication of such source code.
*
*/

package com.appdynamics.extensions.aws.config;

/**
* Created by bhuvnesh.kumar on 8/16/18.
*/
public class ControllerInformation {

private String controllerHost;
private Integer controllerPort;
private String account;
private String username;
private String password;
private String encryptedPassword;
private String encryptionKey;
private Boolean simEnabled;
private String applicationName;
private String tierName;
private String nodeName;
private Boolean controllerSslEnabled;
protected Boolean enableOrchestration;
protected String uniqueHostId;
protected String accountAccessKey;
protected String machinePath;

public Boolean getEnableOrchestration() {
return enableOrchestration;
}

public void setEnableOrchestration(Boolean enableOrchestration) {
this.enableOrchestration = enableOrchestration;
}

public String getUniqueHostId() {
return uniqueHostId;
}

public void setUniqueHostId(String uniqueHostId) {
this.uniqueHostId = uniqueHostId;
}

public String getAccountAccessKey() {
return accountAccessKey;
}

public void setAccountAccessKey(String accountAccessKey) {
this.accountAccessKey = accountAccessKey;
}

public String getMachinePath() {
return machinePath;
}

public void setMachinePath(String machinePath) {
this.machinePath = machinePath;
}


public Boolean getControllerSslEnabled() {
return controllerSslEnabled;
}

public void setControllerSslEnabled(Boolean controllerSslEnabled) {
this.controllerSslEnabled = controllerSslEnabled;
}

public String getControllerHost() {
return controllerHost;
}

public void setControllerHost(String controllerHost) {
this.controllerHost = controllerHost;
}

public Integer getControllerPort() {
return controllerPort;
}

public void setControllerPort(Integer controllerPort) {
this.controllerPort = controllerPort;
}

public String getAccount() {
return account;
}

public void setAccount(String account) {
this.account = account;
}

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}

public String getEncryptedPassword() {
return encryptedPassword;
}

public void setEncryptedPassword(String encryptedPassword) {
this.encryptedPassword = encryptedPassword;
}

public String getEncryptionKey() {
return encryptionKey;
}

public void setEncryptionKey(String encryptionKey) {
this.encryptionKey = encryptionKey;
}

public Boolean getSimEnabled() {
return simEnabled;
}

public void setSimEnabled(Boolean simEnabled) {
this.simEnabled = simEnabled;
}

public String getApplicationName() {
return applicationName;
}

public void setApplicationName(String applicationName) {
this.applicationName = applicationName;
}

public String getTierName() {
return tierName;
}

public void setTierName(String tierName) {
this.tierName = tierName;
}

public String getNodeName() {
return nodeName;
}

public void setNodeName(String nodeName) {
this.nodeName = nodeName;
}

}
Loading