[TSDR-52] Accept metrics list when bytes and packet metrics are missing Created: 14/Apr/18 Updated: 16/Apr/18 Resolved: 14/Apr/18 |
|
| Status: | Resolved |
| Project: | tsdr |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Medium |
| Reporter: | Scott Melton | Assignee: | Scott Melton |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | 0 minutes | ||
| Time Spent: | 1 hour | ||
| Original Estimate: | 0 minutes | ||
| Description |
|
In NodeConnectorStatisticsChangeHandler a TDRMetricRecord list is built with direct array[] access from the FlowCapableNodeConnectorStatistics supplied. In some cases, a FlowCapableNodeConnectorStatistics instance is supplied without bytes and packet metrics. This fix enables building the TSDRMetricRecord with or without the bytes and packet metrics. It was failing when FlowCapableNodeConnectorStatistics did not supply the bytes and packet metrics. If this effects downstream processing, then that should probably be fixed to accomodate this change. The failing code was padding the TSDRMetricsRecord with a timestamp and no data. If downstream needs this then we should probably fix that as there is no data associated with the timestamp.
|
| Comments |
| Comment by Scott Melton [ 14/Apr/18 ] |
|
Fix was to properly build the TSDRMetricsRecord list when bytes and packet metrics are missing from the supplied FlowCapableNodeConnectorStatistics instance. The list builder assumed that if the other met4rics were present then the bytes and packet data was there too. This may indicate that the FlowCapableNodeConnectorStatistics isn't being built completely when the bytes and packet data is unavailable. |
| Comment by Scott Melton [ 14/Apr/18 ] |
|
Opened |
| Comment by Scott Melton [ 14/Apr/18 ] |
|
The failing test case below exposes NodeConnectorStatisticsChangeHandler is not checking for missing data returned from FlowCapableNodeConnectorStatistics before building the TSDRMetricsRecord.
org.opendaylight.tsdr.datacollection.DataCollectionTest |
| Comment by Anil Belur [ 16/Apr/18 ] |
|
scottmelton If this test is already fixed in master branch, then should this test also be cherry picked to Carbon since it is still supported? |
| Comment by Scott Melton [ 16/Apr/18 ] |
|
Yes, probably. I checked in the exact same code that was in master into carbon under a seperate patch. Is there a need to cherry pick? It is the exact code in both master and carbon? I will apply fixes to master and cherry pick to carbon in the future. I can redo that here if you think it is necessary? Thanks for looking after this. |