-
Notifications
You must be signed in to change notification settings - Fork 153
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
2,563 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,179 @@ | ||
<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/maven-v4_0_0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.elasticsearch</groupId> | ||
<artifactId>support-diagnostics</artifactId> | ||
<version>2.0.1</version> | ||
<packaging>jar</packaging> | ||
<name>Support Diagnostics Utilities</name> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-webmvc</artifactId> | ||
<version>4.1.6.RELEASE</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>commons-logging</groupId> | ||
<artifactId>commons-logging</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.httpcomponents</groupId> | ||
<artifactId>httpclient</artifactId> | ||
<version>4.3.5</version> | ||
<exclusions> | ||
<exclusion> | ||
<groupId>commons-logging</groupId> | ||
<artifactId>commons-logging</artifactId> | ||
</exclusion> | ||
</exclusions> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.fasterxml.jackson.core</groupId> | ||
<artifactId>jackson-databind</artifactId> | ||
<version>2.5.3</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>junit</groupId> | ||
<artifactId>junit</artifactId> | ||
<version>4.11</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.springframework</groupId> | ||
<artifactId>spring-test</artifactId> | ||
<version>4.1.6.RELEASE</version> | ||
<scope>test</scope> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.slf4j</groupId> | ||
<artifactId>jcl-over-slf4j</artifactId> | ||
<version>1.7.7</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>com.beust</groupId> | ||
<artifactId>jcommander</artifactId> | ||
<version>1.35</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
<version>1.1.3</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.yaml</groupId> | ||
<artifactId>snakeyaml</artifactId> | ||
<version>1.15</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>commons-io</groupId> | ||
<artifactId>commons-io</artifactId> | ||
<version>2.4</version> | ||
</dependency> | ||
|
||
<dependency> | ||
<groupId>org.apache.commons</groupId> | ||
<artifactId>commons-compress</artifactId> | ||
<version>1.10</version> | ||
</dependency> | ||
|
||
|
||
</dependencies> | ||
|
||
<build> | ||
<!--<finalName>support-diagnostics</finalName>--> | ||
<resources> | ||
<resource> | ||
<directory>src/main/resources</directory> | ||
<excludes> | ||
<exclude>*.*</exclude> | ||
</excludes> | ||
<filtering>true</filtering> | ||
</resource> | ||
</resources> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-compiler-plugin</artifactId> | ||
<version>3.2</version> | ||
<configuration> | ||
<source>1.7</source> | ||
<target>1.7</target> | ||
<verbose>true</verbose> | ||
<fork>true</fork> | ||
<compilerVersion>1.8</compilerVersion> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>2.6</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addDefaultImplementationEntries> | ||
true | ||
</addDefaultImplementationEntries> | ||
<addClasspath>false</addClasspath> | ||
</manifest> | ||
<manifestEntries> | ||
<Implementation-Version>${project.version}</Implementation-Version> | ||
</manifestEntries> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<version>2.8</version> | ||
<executions> | ||
<execution> | ||
<id>copy-installed</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>copy-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}/lib</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<version>2.5.5</version> | ||
<configuration> | ||
<!-- Configures the used assembly descriptor --> | ||
<descriptors> | ||
<descriptor>src/main/assembly/assembly.xml</descriptor> | ||
</descriptors> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>make-assembly</id> <!-- this is used for inheritance merges --> | ||
<phase>package</phase> <!-- bind to the packaging phase --> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
@echo off | ||
setlocal | ||
|
||
set JAVA_EXEC=java | ||
if not defined JAVA_HOME ( | ||
set JAVA_EXEC=java | ||
echo No Java Home was found. Using current path. If execution fails please install Java and make sure it is in the search path or exposed via the JAVA_HOME environment variable. | ||
) else ( | ||
echo JAVA_HOME found, using %JAVA_HOME% | ||
set JAVA_EXEC=%JAVA_HOME%\bin\java | ||
) | ||
|
||
if not defined DIAG_JAVA_OPTIONS ( | ||
set DIAG_JAVA_OPTIONS=-Xmx512m | ||
) | ||
|
||
"%JAVA_EXEC%" %DIAG JAVA_OPTIONS% -cp .\;.\lib\* com.elastic.support.diagnostics.DiagnosticApp %* | ||
|
||
endlocal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [ -x "$JAVA_HOME/bin/java" ]; then | ||
JAVA="$JAVA_HOME/bin/java" | ||
else | ||
JAVA=`which java` | ||
fi | ||
|
||
echo "Using ${JAVA} as Java Runtime" | ||
|
||
if [ ! -x "$JAVA" ]; then | ||
echo "Could not find any executable java binary. Please install java in your PATH and/or set JAVA_HOME" | ||
exit 1 | ||
fi | ||
|
||
[[ ${DIAG_DEBUG} != "" ]] && export DIAG_DEBUG_OPTS=" -Xdebug -Xrunjdwp:server=y,transport=dt_socket,address=8000,suspend=y" | ||
|
||
[[ ${DIAG_JAVA_OPTS} == "" ]] && export DIAG_JAVA_OPTS="-Xms256m -Xmx2000m" | ||
|
||
echo "Using ${DIAG_JAVA_OPTS} ${DIAG_DEBUG_OPTS} for options." | ||
"$JAVA" $DIAG_JAVA_OPTS ${DIAG_DEBUG_OPTS} -cp .:./lib/* com.elastic.support.diagnostics.DiagnosticApp "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<assembly> | ||
<id>dist</id> | ||
<!-- Specifies that our binary distribution is a zip package --> | ||
<formats> | ||
<format>zip</format> | ||
</formats> | ||
|
||
<fileSets> | ||
|
||
<fileSet> | ||
<directory>${project.basedir}/scripts</directory> | ||
<outputDirectory>.</outputDirectory> | ||
<includes> | ||
<include>*</include> | ||
</includes> | ||
</fileSet> | ||
|
||
<fileSet> | ||
<directory>${project.basedir}</directory> | ||
<outputDirectory>.</outputDirectory> | ||
<includes> | ||
<include>readme.md</include> | ||
</includes> | ||
</fileSet> | ||
|
||
<fileSet> | ||
<directory>${project.basedir}/src/main/resources</directory> | ||
<outputDirectory>.</outputDirectory> | ||
<includes> | ||
<include>*</include> | ||
</includes> | ||
</fileSet> | ||
|
||
<fileSet> | ||
<directory>${project.build.directory}</directory> | ||
<outputDirectory>./lib</outputDirectory> | ||
<includes> | ||
<include>support-diagnostics-*.jar</include> | ||
</includes> | ||
</fileSet> | ||
|
||
<fileSet> | ||
<directory>${project.build.directory}/lib</directory> | ||
<outputDirectory>./lib</outputDirectory> | ||
<includes> | ||
<include>*</include> | ||
</includes> | ||
</fileSet> | ||
|
||
</fileSets> | ||
</assembly> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.elastic.support; | ||
|
||
|
||
import java.text.SimpleDateFormat; | ||
import java.util.Date; | ||
|
||
public class SystemProperties { | ||
|
||
|
||
public static final String osName = System.getProperty("os.name"); | ||
|
||
public static final String pathSeparator = System.getProperty("path.separator"); | ||
|
||
public static final String fileSeparator = System.getProperty("file.separator"); | ||
|
||
public static final String lineSeparator = System.getProperty("line.separator"); | ||
|
||
public static final String userDir = System.getProperty("user.dir"); | ||
|
||
public static final String userHome = System.getProperty("user.home"); | ||
|
||
private static final String UTC_DATE_FORMAT = "MM/dd/yyyy KK:mm:ss a Z"; | ||
|
||
private static final String FILE_DATE_FORMAT = "yyyyMMdd-KKmmssa"; | ||
|
||
public static String getUtcDateString(){ | ||
Date curDate = new Date(); | ||
SimpleDateFormat format = new SimpleDateFormat(UTC_DATE_FORMAT); | ||
return format.format(curDate); | ||
} | ||
|
||
public static String getFileDateString(){ | ||
Date curDate = new Date(); | ||
SimpleDateFormat format = new SimpleDateFormat(FILE_DATE_FORMAT); | ||
return format.format(curDate); | ||
} | ||
} |
Oops, something went wrong.