Skip to content

Commit 02b83ab

Browse files
author
Ruslan Gainutdinov
committed
v. 0.8 Added ability to configure Redis password by REDIS_PASSWORD env variable
1 parent 4a61e96 commit 02b83ab

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

README.md

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,22 +45,19 @@ Maven repository is created using [jitpack.io](https://jitpack.io/) [![](https:/
4545
<dependency>
4646
<groupId>com.wizecore</groupId>
4747
<artifactId>persistent-metrics</artifactId>
48-
<version>0.7</version>
48+
<version>0.8</version>
4949
</dependency>
5050
```
5151

52-
## Configuring Redis
52+
## Configuring
5353

5454
By default it uses locally installed Redis (default port, i.e. 6379)
55-
To configure redis use following environment variables:
55+
To configure use following environment variables:
5656

5757
* REDIS_CONF - Redisson JSON [config](https://github.com/redisson/redisson/wiki/2.-Configuration#221-jsonyaml-file-based-configuration) file. Takes precedence.
58-
* REDIS_ADDR - host:port for single server.
59-
60-
## Configuring prefix
61-
62-
By default all metrics is put in redis using prefix "metrics.".
63-
To configure different prefix use METRIC_PREFIX environment variable (dot at the end is added automatically).
58+
* REDIS_ADDR - host:port for single server. Have no effect if REDIS_CONF is defined.
59+
* METRIC_PREFIX - Prefix for all values stored. Default is "metrics.". Dot at the end is added automatically.
60+
* REDIS_PASSWORD - Password for single server. Have no effect if REDIS_CONF is defined.
6461

6562
## License
6663

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<groupId>com.wizecore</groupId>
55
<artifactId>persistent-metrics</artifactId>
66
<packaging>jar</packaging>
7-
<version>0.7</version>
7+
<version>0.8</version>
88
<name>persistent-metrics</name>
99
<url>http://github.com/wizecore/persistent-metrics</url>
1010

src/main/java/com/wizecore/metrics/PersistenceUtil.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ protected static void init() {
6464
redisAddr = System.getenv("REDIS_ADDR");
6565
}
6666

67+
if (redisPassword == null) {
68+
redisPassword = System.getenv("REDIS_PASSWORD");
69+
}
70+
6771
if (metricPrefix == null) {
6872
metricPrefix = System.getenv("METRIC_PREFIX");
6973
}

0 commit comments

Comments
 (0)