Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce queries and also added Indentation #17

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MAVRICK-1
Copy link

With these modifications, the get_results method will make a single query to the API with lists of originasns and asns, instead of multiple queries for each combination. It will also appropriately handle caching of results. And also added Indentation to Output and Json file
This Solves #7

Snippet Of Ouput

hegemony.py

PS C:\Users\RISHI\Desktop\abondance> python -u "c:\Users\RISHI\Desktop\abondance\ihr\hegemony.py"
[
    [
        {
            "timebin": "2019-09-16T00:00:00Z",
            "originasn": 2907,
            "asn": 3356,
            "hege": 0.00492094673231115,
            "af": 4,
            "asn_name": "LEVEL3, US",
            "originasn_name": "SINET-AS Research Organization of Information and Systems, National Institute of Informatics, JP"
        },
        {
            "timebin": "2019-09-16T00:00:00Z",
            "originasn": 2907,
            "asn": 1299,
            "hege": 0.0239604148423363,
            "af": 4,
            "asn_name": "TWELVE99 Arelion Sweden AB, SE",
            "originasn_name": "SINET-AS Research Organization of Information and Systems, National Institute of Informatics, JP"
        },
---
      {
        "asn": 7922,
        "timebin": "2019-09-15T15:30:00Z",
        "magnitude": 3.74536221041079,
        "asn_name": "COMCAST-7922, US"
    },
    {
        "asn": 2907,
        "timebin": "2019-09-15T16:30:00Z",
        "magnitude": 0.0,
        "asn_name": "SINET-AS Research Organization of Information and Systems, National Institute of Informatics, JP"  
    }
----}

link_delay.py

PS C:\Users\RISHI\Desktop\abondance> python -u "c:\Users\RISHI\Desktop\abondance\ihr\link_delay.py"

{
    "asn": 2907,
    "timebin": "2019-09-15T00:30:00Z",
    "magnitude": 0.0,
    "asn_name": "SINET-AS Research Organization of Information and Systems, National Institute of Informatics, JP"
}

@romain-fontugne @m-appel can you review my PR :-)

@MAVRICK-1
Copy link
Author

@romain-fontugne sir ,review my changes when you got time :-)

@romain-fontugne
Copy link
Member

Thanks this is good, but it will break if the user gives too many ASes. If the URL is too long it will fail.
Two solutions, either we could just limit the number the max ASes the user can give. Or we have to do multiple queries.

@MAVRICK-1
Copy link
Author

MAVRICK-1 commented Feb 17, 2024

Thanks this is good, but it will break if the user gives too many ASes. If the URL is too long it will fail. Two solutions, either we could just limit the number the max ASes the user can give. Or we have to do multiple queries.

@romain-fontugne When executing multiple queries, it may consume time. In such cases, opting for maximum Autonomous System Numbers (ASes) could be beneficial. If the limit is reached, the system can then proceed to query the remainder of the list. As for determining the limit

@MAVRICK-1
Copy link
Author

and can you clarify this also #3 (comment) so that I can solve this also

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants