summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cleaner.go3
-rw-r--r--config.go1
-rw-r--r--config.json1
3 files changed, 3 insertions, 2 deletions
diff --git a/cleaner.go b/cleaner.go
index 74875d0..588dbec 100644
--- a/cleaner.go
+++ b/cleaner.go
@@ -14,7 +14,6 @@ const (
DATABASE_PASS = "nil"
DATABASE_CONNECTION = "" //e.g. "tcp(localhost:55555)
DATABASE_NAME = "netflow"
- EPSILON = 1000
)
func cleanData(conf Config) (err error) {
@@ -61,7 +60,7 @@ func cleanData(conf Config) (err error) {
//Add noise for differential privacy
for i := range cDat {
- cDat[i].occurances = diffpriv(cDat[i].occurances, 1, EPSILON)
+ cDat[i].occurances = diffpriv(cDat[i].occurances, 1, conf.Epsilon)
}
//Begin transaction
diff --git a/config.go b/config.go
index fb023dd..af84071 100644
--- a/config.go
+++ b/config.go
@@ -9,6 +9,7 @@ import (
type Config struct {
Volumes []VolumeInfo `json:volumes`
Interval string `json:interval`
+ Epsilon float64 `json:epsilon`
}
type VolumeInfo struct {
diff --git a/config.json b/config.json
index 10519b7..645a760 100644
--- a/config.json
+++ b/config.json
@@ -1,5 +1,6 @@
{
"interval": "5min",
+ "epsilon": 10000,
"volumes": [
{
"size": "small",