Avro
  1. Avro
  2. AVRO-273

Stopwatch: simple class to encapsulate time for statistics gathering

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.3.0
    • Component/s: java
    • Labels:
      None
    • Hadoop Flags:
      Reviewed

      Description

      To measure the duration of an RPC call, I need something that encapsulates the start and stop time. This is something simple that fits the bill.

      The main thing I needed was the ability to swap out tick timers: otherwise things get unwieldy for testing.

      1. AVRO-273.patch.txt
        6 kB
        Philip Zeyliger
      2. AVRO-273.patch.txt
        6 kB
        Philip Zeyliger
      3. AVRO-273.patch.txt
        6 kB
        Philip Zeyliger

        Issue Links

          Activity

          Hide
          Doug Cutting added a comment -

          I just committed this. Thanks, Philip!

          Show
          Doug Cutting added a comment - I just committed this. Thanks, Philip!
          Hide
          Philip Zeyliger added a comment -

          I'm game with making this stuff package-private. (The only thing that would be public would be the StatsPlugin and StatsServlet themselves). The only changes between the patch files are:

          -public class Stopwatch  {
          +class Stopwatch  {
          -public class FakeTicks implements Ticks {
          +class FakeTicks implements Ticks {
          
          Show
          Philip Zeyliger added a comment - I'm game with making this stuff package-private. (The only thing that would be public would be the StatsPlugin and StatsServlet themselves). The only changes between the patch files are: -public class Stopwatch { +class Stopwatch { -public class FakeTicks implements Ticks { +class FakeTicks implements Ticks {
          Hide
          Doug Cutting added a comment -

          This doesn't feel at home in the ipc package. I'd prefer this were either:

          • included as a package-private class included in AVRO-273; or:
          • moved to the util package, if we think it is of general utility to Avro developers.
          Show
          Doug Cutting added a comment - This doesn't feel at home in the ipc package. I'd prefer this were either: included as a package-private class included in AVRO-273 ; or: moved to the util package, if we think it is of general utility to Avro developers.
          Hide
          Philip Zeyliger added a comment -

          D'oh. Checkstyle was failing because of a missing "final" on a constant. Refreshing patch.

          Show
          Philip Zeyliger added a comment - D'oh. Checkstyle was failing because of a missing "final" on a constant. Refreshing patch.
          Hide
          Philip Zeyliger added a comment -

          Attaching patch.

          This is the first of the patches to introduce a new package ("org/apache/avro/ipc/stats"), which is where I'm sticking AVRO-270 specific stuff.

          Show
          Philip Zeyliger added a comment - Attaching patch. This is the first of the patches to introduce a new package ("org/apache/avro/ipc/stats"), which is where I'm sticking AVRO-270 specific stuff.

            People

            • Assignee:
              Philip Zeyliger
              Reporter:
              Philip Zeyliger
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development