Fix README
This commit is contained in:
commit
4887e25374
18
README.md
18
README.md
|
@ -16,6 +16,18 @@ HMCi is a small utility to fetch metrics from one or more HMC's and push those t
|
||||||
|
|
||||||
You can download [Grafana](https://www.power-devops.com/grafana) and [InfluxDB](https://www.power-devops.com/influxdb) ppc64le packages for most Linux distributions and AIX from the [Power DevOps](https://www.power-devops.com/) site.
|
You can download [Grafana](https://www.power-devops.com/grafana) and [InfluxDB](https://www.power-devops.com/influxdb) ppc64le packages for most Linux distributions and AIX from the [Power DevOps](https://www.power-devops.com/) site.
|
||||||
|
|
||||||
|
#### Notes
|
||||||
|
|
||||||
|
Examples on how to change the default InfluxDB retention policy:
|
||||||
|
|
||||||
|
ALTER RETENTION POLICY "autogen" ON "hmci" DURATION 156w
|
||||||
|
ALTER RETENTION POLICY "autogen" ON "hmci" DURATION 90d
|
||||||
|
|
||||||
|
#### InfluxDB and Grafana Packages
|
||||||
|
|
||||||
|
You can download [Grafana ppc64le](https://www.power-devops.com/grafana) and [InfluxDB ppc64le](https://www.power-devops.com/influxdb) packages for most Linux distributions and AIX on the [Power DevOps](https://www.power-devops.com/) site.
|
||||||
|
|
||||||
|
Binaries for amd64/x86 are available from the [Grafana website](https://grafana.com/grafana/download) and [InfluxDB website](https://portal.influxdata.com/downloads/) and also directly from your Linux distribution repository in some cases.
|
||||||
|
|
||||||
## Development Information
|
## Development Information
|
||||||
|
|
||||||
|
@ -23,12 +35,12 @@ You need JDK version 8 or later.
|
||||||
|
|
||||||
### Build & Test
|
### Build & Test
|
||||||
|
|
||||||
Use the gradle-wrapper build tool
|
Use the gradle build tool, which will download all required dependencies.
|
||||||
|
|
||||||
./gradlew clean build
|
./gradlew clean build
|
||||||
|
|
||||||
|
|
||||||
### InfluxDB for local testing
|
#### InfluxDB for local testing
|
||||||
|
|
||||||
Start the InfluxDB container
|
Start the InfluxDB container
|
||||||
|
|
||||||
|
@ -39,7 +51,7 @@ To use the Influx client from the same container
|
||||||
docker exec -it influxdb influx
|
docker exec -it influxdb influx
|
||||||
|
|
||||||
|
|
||||||
### Grafana for local testing
|
#### Grafana for local testing
|
||||||
|
|
||||||
Start the Grafana container, linking it to the InfluxDB container
|
Start the Grafana container, linking it to the InfluxDB container
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@ class InfluxClient {
|
||||||
InfluxDB influxDB
|
InfluxDB influxDB
|
||||||
BatchPoints batchPoints
|
BatchPoints batchPoints
|
||||||
|
|
||||||
|
|
||||||
InfluxClient(String url, String username, String password, String database) {
|
InfluxClient(String url, String username, String password, String database) {
|
||||||
this.url = url
|
this.url = url
|
||||||
this.username = username
|
this.username = username
|
||||||
|
@ -44,6 +45,7 @@ class InfluxClient {
|
||||||
this.database = database
|
this.database = database
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void login() {
|
void login() {
|
||||||
if(!influxDB) {
|
if(!influxDB) {
|
||||||
try {
|
try {
|
||||||
|
@ -51,9 +53,8 @@ class InfluxClient {
|
||||||
createDatabase()
|
createDatabase()
|
||||||
|
|
||||||
// Enable batch writes to get better performance.
|
// Enable batch writes to get better performance.
|
||||||
BatchOptions options = BatchOptions.DEFAULTS.actions(300).flushDuration(500);
|
//BatchOptions options = BatchOptions.DEFAULTS.actions(300).flushDuration(500);
|
||||||
influxDB.enableBatch(options);
|
influxDB.enableBatch(BatchOptions.DEFAULTS);
|
||||||
|
|
||||||
//influxDB.setLogLevel(InfluxDB.LogLevel.BASIC);
|
//influxDB.setLogLevel(InfluxDB.LogLevel.BASIC);
|
||||||
|
|
||||||
batchPoints = BatchPoints.database(database).precision(TimeUnit.SECONDS).build();
|
batchPoints = BatchPoints.database(database).precision(TimeUnit.SECONDS).build();
|
||||||
|
@ -65,6 +66,7 @@ class InfluxClient {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void logoff() {
|
void logoff() {
|
||||||
influxDB?.close();
|
influxDB?.close();
|
||||||
influxDB = null
|
influxDB = null
|
||||||
|
@ -72,18 +74,9 @@ class InfluxClient {
|
||||||
|
|
||||||
|
|
||||||
void createDatabase() {
|
void createDatabase() {
|
||||||
// Create a database...
|
// Create our database... with a default retention of 156w == 3 years
|
||||||
influxDB.query(new Query("CREATE DATABASE " + database));
|
influxDB.query(new Query("CREATE DATABASE " + database + " WITH DURATION 156w"));
|
||||||
influxDB.setDatabase(database);
|
influxDB.setDatabase(database);
|
||||||
|
|
||||||
/*
|
|
||||||
// ... and a retention policy, if necessary.
|
|
||||||
String retentionPolicyName = "HMCI_ONE_YEAR";
|
|
||||||
influxDB.query(new Query("CREATE RETENTION POLICY " + retentionPolicyName
|
|
||||||
+ " ON " + database + " DURATION 365d REPLICATION 1 DEFAULT"));
|
|
||||||
influxDB.setRetentionPolicy(retentionPolicyName);
|
|
||||||
*/
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -96,7 +89,6 @@ class InfluxClient {
|
||||||
logoff()
|
logoff()
|
||||||
login()
|
login()
|
||||||
}
|
}
|
||||||
//influxDB.flush()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue