Skip to content

Commit 99f47b0

Browse files
Merge branch 'master' of github.com:InternetHealthReport/kafka-toolbox
2 parents 1832624 + 24014b8 commit 99f47b0

File tree

10 files changed

+29
-28
lines changed

10 files changed

+29
-28
lines changed

atlas/producers/requirements.txt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
arrow==1.2.3
2-
confluent_kafka==2.0.2
3-
msgpack_python==0.5.6
4-
numpy==1.19.5
5-
requests==2.27.1
6-
requests_futures==1.0.0
7-
ripe==0.0.4
8-
ripe.atlas.cousteau==2.0.0
1+
arrow
2+
confluent_kafka
3+
msgpack_python
4+
numpy
5+
requests
6+
requests_futures
7+
ripe
8+
ripe.atlas.cousteau

bgp/producers/bgpstream2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def pushData(record_type, collector, startts, endts):
162162
timeStart = args.startTime
163163
else:
164164
if recordType == 'updates':
165-
timeStart = currentTime.replace(microsecond=0, second=0, minute=minuteStart)-timedelta(minutes=3*timeWindow)
165+
timeStart = currentTime.replace(microsecond=0, second=0, minute=minuteStart)-timedelta(minutes=2*timeWindow)
166166
else:
167167
delay = 120
168168
if 'rrc' in collector:
@@ -175,7 +175,7 @@ def pushData(record_type, collector, startts, endts):
175175
timeEnd = args.endTime
176176
else:
177177
if recordType == 'updates':
178-
timeEnd = currentTime.replace(microsecond=0, second=0, minute=minuteStart)-timedelta(minutes=2*timeWindow)
178+
timeEnd = currentTime.replace(microsecond=0, second=0, minute=minuteStart)-timedelta(minutes=1*timeWindow)
179179
else:
180180
timeEnd = currentTime
181181

generic/detector/requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
confluent_kafka==2.0.2
2-
msgpack_python==0.5.6
1+
confluent_kafka
2+
msgpack_python
33
arrow

handy/requirements.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
arrow==1.2.3
2-
confluent_kafka==2.0.2
3-
msgpack_python==0.5.6
1+
arrow
2+
confluent_kafka
3+
msgpack_python

ihr.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
KAFKA_HOST=10.0.1.12:9092
1+
KAFKA_HOST=kafka1.storage.iijlab.net:9092,kafka2.storage.iijlab.net:9092,kafka6.storage.iijlab.net:9092
22
DB_CONNECTION_STRING=host=10.0.1.155 dbname=ihr user=romain

psql/consumers/.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
KAFKA_HOST=10.0.1.176:9092
2+
DB_CONNECTION_STRING=host=10.0.1.155 dbname=ihr user=romain

psql/consumers/ASHegemony.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def run(self):
8484

8585
if msg is None:
8686
nb_timeout += 1
87-
if nb_timeout > 60:
87+
if nb_timeout > 180:
8888
logging.warning("Time out!")
8989
break
9090
self.commit()

psql/consumers/ASHegemony_prefix.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def __init__(self, topic, af, start, end, host="localhost", dbname="ihr"):
4444
# conn_string = "host='127.0.0.1' dbname='%s'" % dbname
4545

4646
self.conn = psycopg2.connect(DB_CONNECTION_STRING)
47-
columns=("timebin", "prefix", "originasn_id", "asn_id", "country_id", "hege", "rpki_status", "irr_status", "delegated_prefix_status", "delegated_asn_status", "af", "descr", "visibility", "moas")
47+
columns=("id", "timebin", "prefix", "originasn_id", "asn_id", "country_id", "hege", "rpki_status", "irr_status", "delegated_prefix_status", "delegated_asn_status", "af", "descr", "visibility", "moas")
4848
self.cpmgr = CopyManager(self.conn, "ihr_hegemony_prefix", columns)
4949
self.cursor = self.conn.cursor()
5050
logging.debug("Connected to the PostgreSQL server")
@@ -235,7 +235,7 @@ def save(self, msg):
235235

236236
# Hegemony values to copy in the database
237237
if hege!= 0:
238-
#("timebin", "prefix", "originasn_id", "asn_id", "country_id", "hege",
238+
#("id", "timebin", "prefix", "originasn_id", "asn_id", "country_id", "hege",
239239
# "rpki_status", "irr_status", "delegated_prefix_status", "delegated_asn_status",
240240
# "af", "descr", "visibility", "moas")
241241

@@ -279,7 +279,7 @@ def save(self, msg):
279279
self.cache['descr'] = descr
280280

281281
self.dataHege.append([
282-
self.currenttime, prefix, int(originasn), int(asn), cc, float(hege),
282+
0, self.currenttime, prefix, int(originasn), int(asn), cc, float(hege),
283283
rov_check['rpki']['status'], rov_check['irr']['status'],
284284
rov_check['delegated']['prefix']['status'], rov_check['delegated']['asn']['status'],
285285
self.af, descr, msg['nb_peers']
@@ -298,7 +298,7 @@ def commit(self):
298298
# set visibility in percentage and add moas
299299
for vec in self.dataHege:
300300
vec[-1] = 100.0*(vec[-1]/self.nb_peers)
301-
rnode = self.rtree.search_best(vec[1])
301+
rnode = self.rtree.search_best(vec[2])
302302
vec.append( len(rnode.data['originasn'])>1 )
303303

304304
logging.warning(f"psql: start copy, ts={self.currenttime}, nb. data points={len(self.dataHege)}")

psql/consumers/docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,23 +66,23 @@ services:
6666
metis_atlas_deployment_v6_as_path_length:
6767
image: "internethealthreport/psql_consumers"
6868
restart: unless-stopped
69-
command: anomalyDetector.py metis_atlas_deployment_v4_as_path_length.conf
69+
command: anomalyDetector.py metis_atlas_deployment_v6_as_path_length.conf
7070
env_file:
7171
- path: .env
7272
required: true # default
7373

7474
metis_atlas_deployment_v6_ip_hops:
7575
image: "internethealthreport/psql_consumers"
7676
restart: unless-stopped
77-
command: anomalyDetector.py metis_atlas_deployment_v4_ip_hops.conf
77+
command: anomalyDetector.py metis_atlas_deployment_v6_ip_hops.conf
7878
env_file:
7979
- path: .env
8080
required: true # default
8181

8282
metis_atlas_deployment_v6_rtt:
8383
image: "internethealthreport/psql_consumers"
8484
restart: unless-stopped
85-
command: anomalyDetector.py metis_atlas_selection_v4_rtt.conf
85+
command: anomalyDetector.py metis_atlas_deployment_v6_rtt.conf
8686
env_file:
8787
- path: .env
8888
required: true # default
@@ -114,23 +114,23 @@ services:
114114
metis_atlas_selection_v6_as_path_length:
115115
image: "internethealthreport/psql_consumers"
116116
restart: unless-stopped
117-
command: anomalyDetector.py metis_atlas_selection_v4_as_path_length.conf
117+
command: anomalyDetector.py metis_atlas_selection_v6_as_path_length.conf
118118
env_file:
119119
- path: .env
120120
required: true # default
121121

122122
metis_atlas_selection_v6_ip_hops:
123123
image: "internethealthreport/psql_consumers"
124124
restart: unless-stopped
125-
command: anomalyDetector.py metis_atlas_selection_v4_ip_hops.conf
125+
command: anomalyDetector.py metis_atlas_selection_v6_ip_hops.conf
126126
env_file:
127127
- path: .env
128128
required: true # default
129129

130130
metis_atlas_selection_v6_rtt:
131131
image: "internethealthreport/psql_consumers"
132132
restart: unless-stopped
133-
command: anomalyDetector.py metis_atlas_selection_v4_rtt.conf
133+
command: anomalyDetector.py metis_atlas_selection_v6_rtt.conf
134134
env_file:
135135
- path: .env
136136
required: true # default

psql/consumers/requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ arrow==1.2.3
33
confluent_kafka==2.0.2
44
geoip2==4.6.0
55
iso3166==2.1.1
6-
kafka==1.3.5
76
kafka_python==2.0.2
87
msgpack_python==0.5.6
98
pgcopy==1.5.0

0 commit comments

Comments
 (0)