Skip to content

Conversation

@seagreen
Copy link

No description provided.

@seagreen
Copy link
Author

First question: how do you feel about the structure of the output?

Example output for the command chronos 'sleep 0.1' 'sleep 0.2' --timeout 0.5 --json:

{"sleep 0.2":{"mean":{"denominator":2000000000,"numerator":407070367},"squared-weights":2,"samples":2,"q-factor":{"denominator":2000000000000000000,"numerator":2931247881}},"sleep 0.1":{"mean":{"denominator":2000000000,"numerator":207569483},"squared-weights":2,"samples":2,"q-factor":{"denominator":2000000000000000000,"numerator":34338684249}}}

Or, prettified:

{
  "sleep 0.2": {
    "mean": {
      "denominator": 2000000000,
      "numerator": 407070367
    },
    "squared-weights": 2,
    "samples": 2,
    "q-factor": {
      "denominator": 2e+18,
      "numerator": 2931247881
    }
  },
  "sleep 0.1": {
    "mean": {
      "denominator": 2000000000,
      "numerator": 207569483
    },
    "squared-weights": 2,
    "samples": 2,
    "q-factor": {
      "denominator": 2e+18,
      "numerator": 34338684249
    }
  }
}

One thing that might be improved is the encoding of rationals.

@knupfer
Copy link
Owner

knupfer commented Mar 21, 2019

I think that's quite good. One thing to think of is that this wouldn't allow for consumption of intermediate results, so we could instead print out a lazy list of objects and if the user likes to get only one output he has to combine it with print-once.

@seagreen
Copy link
Author

I like that idea. I think it will make the code a little nicer too. I'll update the PR when I get a chance.

@seagreen
Copy link
Author

Got busy and am going to abandon this, hopefully someone else can pick it up.

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