Giter VIP home page Giter VIP logo

Comments (3)

rishabhknowss avatar rishabhknowss commented on September 4, 2024

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.

romain-fontugne avatar romain-fontugne commented on September 4, 2024

Hi,

A similar code is already in psql/consumers/ASHegemony.py:

self.hegemonyCone[asn] += inc

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.

rishabhknowss avatar rishabhknowss commented on September 4, 2024

Okay! On it

from kafka-toolbox.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.