Opened 4 years ago

Closed 4 years ago

#15177 closed enhancement (fixed)

Add fractional times of relays having flags assigned to them to uptime documents

Reported by: karsten Owned by:
Priority: Medium Milestone:
Component: Metrics/Onionoo Version:
Severity: Keywords:
Cc: weasel Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

weasel considers querying Onionoo to put together a list of fallback directories that clients shall use in their bootstrap process instead of the directory authorities. Requirements for these fallback directories include (but are not limited to):

  • have been Running in at least 99% of consensuses in the last 4 months and
  • have had the Guard flag assigned in at least 90% of consensuses.

The "Running" part already exists with the uptime documents, and I wonder if we should extend that towards listing what fraction of a relay's uptime that relay had flags assigned. See the "flags" part in the following example:

{
    "version": "2.2",
    "relays_published": "2015-03-06 11:00:00",
    "relays": [
        {
            "fingerprint": "847B1F850344D7876491A54892F904934E4EB85D",
            "uptime": {
                "3_months": {
                    "first": "2014-12-04 06:00:00",
                    "last": "2015-03-06 06:00:00",
                    "interval": 43200,
                    "factor": 0.001001001001001001,
                    "count": 185,
                    "values": [
                        999,
                        999,
                        999,
                        ...
                        999,
                        999,
                        999
                    ],
                    "flags": {
                        "Authority": 1.0,
                        "HSDir": 0.998,
                        "Running": 1.0,
                        "Stable": 1.0,
                        "V2Dir": 1.0,
                        "Valid": 1.0
                    }
                }
            }
        }
    ]
}

This "flags" field would say that the relay had the Guard flag in 100% of consensuses known between 2014-12-04 06:00:00 and 2015-03-06 06:00:00. While that's 3 months, not 4, this might be close enough as requirements for a fallback directory.

Similarly, the fraction of the relay having the Running flag could be looked up there, rather than computing the average of "values" and multiplying the result with "factor".

weasel, would this help?

Child Tickets

Attachments (1)

uptime-847B1F85.json (14.3 KB) - added by karsten 4 years ago.

Download all attachments as: .zip

Change History (5)

comment:1 Changed 4 years ago by karsten

weasel says on IRC that he'd rather have more detailed information when a relay had which flags, so that he could do things like weighting recent flags more than older ones or pick different time frames than 3 months or 1 year.

New suggestion: add an object "flags" adjacent to "uptime" and include a history object for each flag the relay ever had. Example:

{
    "version": "2.2",
    "relays_published": "2015-03-06 11:00:00",
    "relays": [
        {
            "fingerprint": "847B1F850344D7876491A54892F904934E4EB85D",
            "uptime": {
                "3_months": {
                    "first": "2014-12-04 06:00:00",
                    "last": "2015-03-06 06:00:00",
                    "interval": 43200,
                    "factor": 0.001001001001001001,
                    "count": 185,
                    "values": [
                        999,
                        999,
                        999,
                        ...
                        999,
                        999,
                        999
                    ]
                }
            },
            "flags": {
                "Authority": {
                    "3_months": {
                        "first": "2014-12-04 06:00:00",
                        "last": "2015-03-06 06:00:00",
                        "interval": 43200,
                        "factor": 0.001001001001001001,
                        "count": 185,
                        "values": [
                            999,
                            999,
                            999,
                            ...
                            999,
                            999,
                            999
                        ]
                    }
                },
                "HSDir": ...,
                "Running": ...,
                "Stable": ...,
                "V2Dir": ...,
                "Valid": ...
            }
        }
    ]
}

comment:2 Changed 4 years ago by karsten

Status: newneeds_review

My branch task-15177 contains a locally tested version that produces uptime documents like the one attached and that I'm going to deploy on the Onionoo mirror tomorrow or the day after.

Changed 4 years ago by karsten

Attachment: uptime-847B1F85.json added

comment:3 Changed 4 years ago by karsten

There, deployed on the mirror with history going back until 2007. Here's an example.

weasel, please take a look if this works for generating a list of fallback directories.

comment:4 Changed 4 years ago by karsten

Resolution: fixed
Status: needs_reviewclosed

weasel confirmed on IRC that this change is good to go. Merged to master and deployed. Resolving.

Note: See TracTickets for help on using tickets.