Feature #1481

Support changing timestamp used for indexing in bag-transform

Added by J. Moringen almost 11 years ago. Updated almost 11 years ago.

Status:ResolvedStart date:04/30/2013
Priority:NormalDue date:
Assignee:J. Moringen% Done:

100%

Category:Commandline Tools
Target version:Robotics Service Bus - rsb-0.9

Related issues

Related to RSBag - Tasks #1480: Change default record ordering from create timestamp to s... Resolved 04/29/2013

History

#1 Updated by J. Moringen almost 11 years ago

  • Status changed from New to In Progress
  • % Done changed from 0 to 50

bag-merge already has the --transform-timestamp option. I have to investigate whether anything needs to be done.

#2 Updated by J. Moringen almost 11 years ago

  • Status changed from In Progress to Resolved
  • % Done changed from 50 to 100

This already works.

Note that just running bag-merge does not perform any re-indexing; it is necessary to use the --transform-timestamp option for that.

Here is transcript of a sessions demonstrating the capability:
  1. Record a log file with default indexing (.i.e "send" timestamp, see #1480):
    $ bag-record -o foo.tide socket:
    2013-07-19T03:01:49.518056+02:00 #<SYNCHRONIZED-CHANNEL "/:INT64" (2) (RSB-EVENT-0.9 INT64) {100C378923}>
    # In parallel: rsb-send 1 socket: && rsb-send 2 socket:
    ^C$ bag-info foo.tide 
    File "foo.tide" 
      Events  : 2
      Start   : 2013-07-19T03:01:45.895464+02:00
      End     : 2013-07-19T03:01:46.639511+02:00
      Duration: 0.744047d0
      Channel "/:INT64" 
        Type    : (RSB-EVENT-0.9 INT64)
        Format  : // Notification.proto
        package rsb.protocol;
        import "rsb/protocol/EventId.proto";
        import "rsb/protoco…
        Events  : 2
        Start   : 2013-07-19T03:01:45.895464+02:00 # <- "send" timestamp of first event
        End     : 2013-07-19T03:01:46.639511+02:00 # <- "send" timestamp of second event
        Duration: 0.744047d0
        Rate    : 2.688002236417861d0
    $ bag-cat --style detailed foo.tide 
    ─────────────────────────────────────────────────────────────────────────────
    Event
      Scope          : /
      Id             : 38E7910F-B0BE-56E3-8E2B-CF159DCF5096
      Sequence-Number: 0
      Origin         : 2437CF05-B431-4FF8-89A8-FBC5F794AD83
      Method         : N/A
    Timestamps
      Create : 2013-07-19T03:01:45.861049+02:00
      Send   : 2013-07-19T03:01:45.895464+02:00 # <- same as "Start" above
      Receive: 2013-07-19T03:01:45.996948+02:00
      Deliver: 2013-07-19T03:01:46.000782+02:00 # <- appears as "Start" below
    Payload (FIXNUM)
      1
    ─────────────────────────────────────────────────────────────────────────────
    Event
      Scope          : /
      Id             : 7A3DCF45-1757-5C81-8094-0D077B7C4EF0
      Sequence-Number: 0
      Origin         : BD2DE94E-D96D-439D-A050-80AEA0C5F274
      Method         : N/A
    Timestamps
      Create : 2013-07-19T03:01:46.605144+02:00
      Send   : 2013-07-19T03:01:46.639511+02:00 # <- same as "End" above
      Receive: 2013-07-19T03:01:46.671568+02:00
      Deliver: 2013-07-19T03:01:46.671591+02:00 # <- appears as "End" below
    Payload (FIXNUM)
      2
    
  2. Transform the log file to index based on "deliver" timestamp
    $ bag-merge --transform-timestamp=:deliver -o bar.tide foo.tide
    [...]
    $ bag-info bar.tide 
    File "bar.tide" 
      Events  : 2
      Start   : 2013-07-19T03:01:46.000782+02:00
      End     : 2013-07-19T03:01:46.671591+02:00
      Duration: 0.670809d0
      Channel "/:INT64" 
        Type    : (RSB-EVENT-0.9 INT64)
        Format  : // Notification.proto
        package rsb.protocol;
        import "rsb/protocol/EventId.proto";
        import "rsb/protoco…
        Events  : 2
        Start   : 2013-07-19T03:01:46.000782+02:00 # <- "deliver" timestamp of first event
        End     : 2013-07-19T03:01:46.671591+02:00 # <- "deliver" timestamp of second event
        Duration: 0.670809d0
        Rate    : 2.9814746075261365d0
    

Also available in: Atom PDF