[vlma-devel] commit: Ensure to provide the right type to the RRD sample. (Adrien Grand )

git version control git at videolan.org
Wed Oct 29 21:44:39 CET 2008


vlma | branch: master | Adrien Grand <jpountz at videolan.org> | Wed Oct 29 21:43:47 2008 +0100| [500955f6486a12cc404f6af1281f5cbcf72ade84] | committer: Adrien Grand 

Ensure to provide the right type to the RRD sample.

> http://git.videolan.org/gitweb.cgi/vlma.git/?a=commit;h=500955f6486a12cc404f6af1281f5cbcf72ade84
---

 .../java/org/videolan/vlma/VLMaServiceImpl.java    |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/vlma-core/src/main/java/org/videolan/vlma/VLMaServiceImpl.java b/vlma-core/src/main/java/org/videolan/vlma/VLMaServiceImpl.java
index 6f4de8d..5cf538b 100644
--- a/vlma-core/src/main/java/org/videolan/vlma/VLMaServiceImpl.java
+++ b/vlma-core/src/main/java/org/videolan/vlma/VLMaServiceImpl.java
@@ -246,7 +246,11 @@ public class VLMaServiceImpl implements VLMaService {
                     logger.error("Error while adding value to the RRD database", e);
                 // Even if there was an error, update the sample so that every data in the sample has the same timestamp
                 try {
-                    sample.setValue(data.name().toLowerCase(), 0);
+                    if(Data.TRAFFIC_IN.equals(data) || Data.TRAFFIC_OUT.equals(data)) {
+                        sample.setValue(data.name().toLowerCase(), 0L);
+                    } else {
+                        sample.setValue(data.name().toLowerCase(), 0d);
+                    }
                 } catch (RrdException f) {
                     // Should not happen
                     logger.error("Unexpected error!", f);



More information about the vlma-devel mailing list