Skip to content

Commit

Permalink
print leaflist properly
Browse files Browse the repository at this point in the history
  • Loading branch information
nsimariaj committed Oct 6, 2023
1 parent f5bf539 commit 9f464c0
Show file tree
Hide file tree
Showing 10 changed files with 1,086 additions and 1,070 deletions.
2,024 changes: 1,014 additions & 1,010 deletions coverage.out

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions subscribe_juniper_junos.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,15 @@ func handleOnePacket(ocData *na_pb.OpenConfigData, jctx *JCtx) {
s += fmt.Sprintf(" bytes_value: %s\n", value.BytesValue)
case *na_pb.KeyValue_LeaflistValue:
s += fmt.Sprintf(" leaf_list_value: %s\n", value.LeaflistValue)
e := kv.GetLeaflistValue().Element
for _, elem := range e {
switch elem.Value.(type) {
case *na_pb.TypedValue_LeaflistStrValue:
llStrValue := elem.GetLeaflistStrValue()
s += fmt.Sprintf(" leaf_list_value(element): %s\n", llStrValue)
}
}

default:
s += fmt.Sprintf(" default: %v\n", value)
}
Expand Down
12 changes: 6 additions & 6 deletions tests/data/juniper-junos/config/jtisim-influx-alias.log
Original file line number Diff line number Diff line change
Expand Up @@ -76,29 +76,29 @@ Successfully initialized InfluxDB Client
compression = none
Connecting to 127.0.0.1:50051
gRPC headers from host 127.0.0.1:50051
content-type: [application/grpc]
jtisim: [yes]
content-type: [application/grpc]
Receiving telemetry data from 127.0.0.1:50051

+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Timestamp | KV | Packets | Bytes | Bytes(wire) |
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Wed Sep 6 05:11:48 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:16 PDT 2023 | 1980 | 40 | 87418 | 87618 |

Batch processing: #packets:40 #points:40
Batch write successful! Post batch write available points: 0

| Wed Sep 6 05:11:50 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:18 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:11:52 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:20 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:11:54 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:22 PDT 2023 | 1980 | 40 | 87418 | 87618 |



Collector Stats for 127.0.0.1:50051 (Run time : 8.003122847s)
Collector Stats for 127.0.0.1:50051 (Run time : 8.016258s)
40 : in-packets
1980 : data points (KV pairs)
25 : in-header wirelength (bytes)
Expand Down
28 changes: 14 additions & 14 deletions tests/data/juniper-junos/config/jtisim-influx.log
Original file line number Diff line number Diff line change
Expand Up @@ -84,50 +84,50 @@ Receiving telemetry data from 127.0.0.1:50051
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Timestamp | KV | Packets | Bytes | Bytes(wire) |
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Wed Sep 6 05:11:23 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:51 PDT 2023 | 1980 | 40 | 87418 | 87618 |

Batch processing: #packets:40 #points:40
Batch write successful! Post batch write available points: 0

| Wed Sep 6 05:11:25 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:53 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:11:27 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:55 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:11:29 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:57 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:11:31 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:59 PDT 2023 | 1980 | 40 | 87418 | 87618 |

Batch processing: #packets:40 #points:40

| Wed Sep 6 05:11:33 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:31:01 PDT 2023 | 3960 | 80 | 174838 | 175238 |

Batch processing: #packets:40 #points:40
Batch write successful! Post batch write available points: 0

| Wed Sep 6 05:11:35 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:31:03 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:11:37 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:31:05 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:11:39 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:31:07 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:11:41 IST 2023 | 4158 | 84 | 183580 | 184000 |
| Fri Oct 6 08:31:09 PDT 2023 | 3960 | 80 | 174838 | 175238 |

Batch processing: #packets:40 #points:40

| Wed Sep 6 05:11:43 IST 2023 | 5940 | 120 | 262258 | 262858 |
| Fri Oct 6 08:31:11 PDT 2023 | 5940 | 120 | 262258 | 262858 |

Batch write successful! Post batch write available points: 0

| Wed Sep 6 05:11:45 IST 2023 | 5940 | 120 | 262258 | 262858 |
| Fri Oct 6 08:31:13 PDT 2023 | 5940 | 120 | 262258 | 262858 |



Collector Stats for 127.0.0.1:50051 (Run time : 25.002066633s)
Collector Stats for 127.0.0.1:50051 (Run time : 25.009833917s)
120 : in-packets
5940 : data points (KV pairs)
25 : in-header wirelength (bytes)
Expand Down
26 changes: 13 additions & 13 deletions tests/data/juniper-junos/config/jtisim-interfaces-1.log
Original file line number Diff line number Diff line change
Expand Up @@ -81,44 +81,44 @@ Receiving telemetry data from 127.0.0.1:50051
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Timestamp | KV | Packets | Bytes | Bytes(wire) |
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Wed Sep 6 05:12:21 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:49 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:12:23 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:51 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:12:25 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:53 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:12:27 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:55 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:12:29 IST 2023 | 2595 | 53 | 114310 | 114575 |
| Fri Oct 6 08:31:57 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:12:31 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:31:59 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:12:33 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:32:01 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:12:35 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:32:03 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:12:37 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:32:05 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:12:39 IST 2023 | 4832 | 98 | 213164 | 213654 |
| Fri Oct 6 08:32:07 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:12:41 IST 2023 | 5940 | 120 | 262258 | 262858 |
| Fri Oct 6 08:32:09 PDT 2023 | 5940 | 120 | 262258 | 262858 |


| Wed Sep 6 05:12:43 IST 2023 | 5940 | 120 | 262258 | 262858 |
| Fri Oct 6 08:32:11 PDT 2023 | 5940 | 120 | 262258 | 262858 |



Collector Stats for 127.0.0.1:50051 (Run time : 25.001286525s)
Collector Stats for 127.0.0.1:50051 (Run time : 25.014281417s)
120 : in-packets
5940 : data points (KV pairs)
25 : in-header wirelength (bytes)
Expand Down
26 changes: 13 additions & 13 deletions tests/data/juniper-junos/config/jtisim-interfaces-2.log
Original file line number Diff line number Diff line change
Expand Up @@ -81,44 +81,44 @@ Receiving telemetry data from 127.0.0.1:50051
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Timestamp | KV | Packets | Bytes | Bytes(wire) |
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Wed Sep 6 05:12:21 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:49 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:12:23 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:51 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:12:25 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:53 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:12:27 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:31:55 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:12:29 IST 2023 | 2626 | 54 | 117002 | 117272 |
| Fri Oct 6 08:31:57 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:12:31 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:31:59 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:12:33 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:32:01 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:12:35 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:32:03 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:12:37 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:32:05 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:12:39 IST 2023 | 5940 | 120 | 262258 | 262858 |
| Fri Oct 6 08:32:07 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:12:41 IST 2023 | 5940 | 120 | 262258 | 262858 |
| Fri Oct 6 08:32:09 PDT 2023 | 5940 | 120 | 262258 | 262858 |


| Wed Sep 6 05:12:43 IST 2023 | 5940 | 120 | 262258 | 262858 |
| Fri Oct 6 08:32:11 PDT 2023 | 5940 | 120 | 262258 | 262858 |



Collector Stats for 127.0.0.1:50051 (Run time : 25.000853863s)
Collector Stats for 127.0.0.1:50051 (Run time : 25.012066s)
120 : in-packets
5940 : data points (KV pairs)
25 : in-header wirelength (bytes)
Expand Down
16 changes: 8 additions & 8 deletions tests/data/juniper-junos/config/jtisim-interfaces-3.log
Original file line number Diff line number Diff line change
Expand Up @@ -81,29 +81,29 @@ Receiving telemetry data from 127.0.0.1:50051
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Timestamp | KV | Packets | Bytes | Bytes(wire) |
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Wed Sep 6 05:10:37 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:05 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:10:39 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:07 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:10:41 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:09 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:10:43 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:11 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:10:45 IST 2023 | 2515 | 51 | 110952 | 111207 |
| Fri Oct 6 08:30:13 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:10:47 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:30:15 PDT 2023 | 3960 | 80 | 174838 | 175238 |


| Wed Sep 6 05:10:49 IST 2023 | 3960 | 80 | 174838 | 175238 |
| Fri Oct 6 08:30:17 PDT 2023 | 3960 | 80 | 174838 | 175238 |



Collector Stats for 127.0.0.1:50051 (Run time : 15.00117689s)
Collector Stats for 127.0.0.1:50051 (Run time : 15.002131291s)
80 : in-packets
3960 : data points (KV pairs)
25 : in-header wirelength (bytes)
Expand Down
5 changes: 4 additions & 1 deletion tests/data/juniper-junos/config/jtisim-interfaces-4.log
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,11 @@ New alias creation failed for 127.0.0.1, err: open : no such file or directory
compression = none
Connecting to 127.0.0.1:90052
subscribe returns, reconnecting after 10s for worker tests/data/juniper-junos/config/jtisim-interfaces-4.json
compression = none
Reconnecting to 127.0.0.1:90052


Collector Stats for 127.0.0.1:90052 (Run time : 10.000834536s)
Collector Stats for 127.0.0.1:90052 (Run time : 10.003562792s)
0 : in-packets
0 : data points (KV pairs)
0 : in-header wirelength (bytes)
Expand All @@ -86,5 +88,6 @@ Collector Stats for 127.0.0.1:90052 (Run time : 10.000834536s)


Streaming for host 127.0.0.1 will be stopped (SIGINT)
subscribe returns, reconnecting after 10s for worker tests/data/juniper-junos/config/jtisim-interfaces-4.json
compression = none
Connection for 127.0.0.1:90052 has been interrupted
4 changes: 2 additions & 2 deletions tests/data/juniper-junos/config/jtisim-interfaces-6.log
Original file line number Diff line number Diff line change
Expand Up @@ -81,11 +81,11 @@ Receiving telemetry data from 127.0.0.1:50051
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Timestamp | KV | Packets | Bytes | Bytes(wire) |
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Wed Sep 6 05:10:33 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:01 PDT 2023 | 1980 | 40 | 87418 | 87618 |



Collector Stats for 127.0.0.1:50051 (Run time : 3.999182937s)
Collector Stats for 127.0.0.1:50051 (Run time : 3.981114417s)
40 : in-packets
1980 : data points (KV pairs)
25 : in-header wirelength (bytes)
Expand Down
6 changes: 3 additions & 3 deletions tests/data/juniper-junos/config/jtisim-prometheus.log
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ Receiving telemetry data from 127.0.0.1:50051
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Timestamp | KV | Packets | Bytes | Bytes(wire) |
+------------------------------+--------------------+--------------------+--------------------+--------------------+
| Wed Sep 6 05:11:17 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:45 PDT 2023 | 1980 | 40 | 87418 | 87618 |


| Wed Sep 6 05:11:19 IST 2023 | 1980 | 40 | 87418 | 87618 |
| Fri Oct 6 08:30:47 PDT 2023 | 1980 | 40 | 87418 | 87618 |



Collector Stats for 127.0.0.1:50051 (Run time : 6.000890712s)
Collector Stats for 127.0.0.1:50051 (Run time : 6.0148505s)
40 : in-packets
1980 : data points (KV pairs)
25 : in-header wirelength (bytes)
Expand Down

0 comments on commit 9f464c0

Please sign in to comment.