Comments (3)
Hi Romain,
While reviewing the enhancement and going through the repository, I think that we need to add logic to compute the number of dependent networks in the psql/consumers/ASHegemony.py
script.
The logic can be implemented as -
def compute_dependent_networks(as_hegemony_values):
# Dictionary to store the count of dependent networks for each AS
dependent_networks_count = {}
# Iterate through AS hegemony values
for as_value in as_hegemony_values:
asn = as_value['asn']
dependent_networks = as_value.get('dependent_networks', [])
# Update the count for each dependent network
for network in dependent_networks:
if network not in dependent_networks_count:
dependent_networks_count[network] = 1
else:
dependent_networks_count[network] += 1
return dependent_networks_count
Additionally, creating a new consumer script to consume messages from the topic where the computed results are pushed, and adding a PostgreSQL schema for storing the count requests.
Well , I am new to Kafka as well as IHR and since I don't have hands-on experience with it, can you please guide me more towards implementing the solution
from kafka-toolbox.
Hi,
A similar code is already in psql/consumers/ASHegemony.py
:
kafka-toolbox/psql/consumers/ASHegemony.py
Line 193 in 89649fb
We need to decouple the two functions that this script has, pushing ASHegemony values to Postgres and computing the number of dependent networks. So I think we should start with a new script that reads ASHegemony values from Kafka and store the number of dependent networks back into kafka.
from kafka-toolbox.
Okay! On it
from kafka-toolbox.
Related Issues (10)
- updated atlas measurement ids
- psql consumer / cron HOT 1
- ASes name in Kafka HOT 3
- Create docker container environment for Kafka-Toolbox repo HOT 2
- Create a README.md file
- Create a README.md for atlas/ptoducers HOT 1
- Create README.md for peeringdb/producers
- Create README.md for peeringdb/producers HOT 2
- Use requirements.txt for each producer and consumer HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kafka-toolbox.