Skip to content

Commit

Permalink
Bug: Use int64 for topology's createdAt. (#16)
Browse files Browse the repository at this point in the history
<!-- Thank you for submitting a pull request to our repository. -->

## Description

Use int64 for topology's createdAt.

<!-- Please provide a brief description of the changes in this pull
request (max 80 chars). -->

## Changes Made

<!-- Please list the changes that you made in this pull request. -->

## Related Issues

<!-- Please list any related issues or pull requests.
Fixes #{bug number} - use this specific format or issues won't be
correctly linked to the PR
-->

## Checklist

<!-- Please check off the following items by putting an "x" in the box:
-->

- [ ] I have used a PR title that is descriptive enough for a release
note.
- [ ] I have tested these changes locally.
- [ ] I have added appropriate tests or updated existing tests.
- [ ] I have tested these changes on a dedicated VM or a customer VM
[name of the VM]
- [ ] I have added appropriate documentation or updated existing
documentation.

---------

Co-authored-by: Bot <[email protected]>
Co-authored-by: tejo <[email protected]>
  • Loading branch information
3 people authored Nov 13, 2023
1 parent 4dc00c8 commit c05ffdb
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 35 deletions.
27 changes: 4 additions & 23 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,12 @@
# ProtoBuf Release Notes

## 0.0.2-dev - 2023-11-09

### Documentation

- Update documentation to reflect protocol buffer refactoring (PR #15 by
@chicco785)

## 0.0.1 - 2023-10-27

### Features

- New protocol buffer for topology data (PR #12 by @chicco785)
- Notification message: support Trigger requirements (PR #6 by @chicco785)
- Add protocol buffer to describe faults (PR #3 by @chicco785)
## 0.0.2-dev - 2023-11-13

### Bug Fixes

- fix typo in `Fault` field `faultCurrent` (PR #7 by @tejo)

### Continuous Integration
- Bug: Use int64 for topology's createdAt. (PR #16 by @tejo)

- Use new shared workflow for Golang (PR #11 by @chicco785)

### Refactoring
### Documentation

- Refactor protobuffer to align with architecture discussion (PR #9 by
- Update documentation to reflect protocol buffer refactoring (PR #15 by
@chicco785)
- Migrate existing protobuf from
`https://github.com/zaphiro-technologies/rabbitmq-poc` (PR #2 by @chicco785)
10 changes: 5 additions & 5 deletions docs/topology.proto.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ direction LR
%%
class Topology {
+ uint64 createdAt
+ int64 createdAt
+ bytes tp
}
Expand All @@ -45,10 +45,10 @@ class Topology {

<div class="comment"><span>A topology computed information.</span><br/><span>Headers used in rabbitMQ:</span><br/><span>* `id`: id of the `Topology`</span><br/><span>* `type`: always `Topology`</span><br/><span>* `producerId`: the id of the producer (e.g. a PMU) linked to the dataset.</span><br/><span>* `timestampId`: related measurement Unix msec timestamp (if any)</span><br/><span>* `subnetworkId`: the sub network id for which the topology was computed</span><br/><span></span><br/></div>

| Field | Ordinal | Type | Label | Description |
|-----------|---------|--------|-------|-------------------------------------------------------------------|
| createdAt | 1 | uint64 | | The time of creation of the topology data (Unix msec timestamp). |
| tp | 2 | bytes | | The TP profile file serialized as bytes. |
| Field | Ordinal | Type | Label | Description |
|-----------|---------|-------|-------|-------------------------------------------------------------------|
| createdAt | 1 | int64 | | The time of creation of the topology data (Unix msec timestamp). |
| tp | 2 | bytes | | The TP profile file serialized as bytes. |



Expand Down
8 changes: 4 additions & 4 deletions pkg/grid/v1/topology.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/grid/v1/topology_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ func generateTopology(timestamp int64) *Topology {
tp, _ := os.ReadFile("FullGrid_TP.xml") // read the content of file

return &Topology{
CreatedAt: uint64(timestamp),
CreatedAt: timestamp,
Tp: tp,
}
}
Expand Down
4 changes: 2 additions & 2 deletions proto/grid/v1/topology.proto
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ Headers used in rabbitMQ:
*/

message Topology {
uint64 createdAt = 1; //The time of creation of the topology data (Unix msec timestamp).
bytes tp = 2; //The TP profile file serialized as bytes.
int64 createdAt = 1; // The time of creation of the topology data (Unix msec timestamp).
bytes tp = 2; // The TP profile file serialized as bytes.
}

1 comment on commit c05ffdb

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Performance Alert ⚠️

Possible performance regression was detected for benchmark.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.50.

Benchmark suite Current: c05ffdb Previous: 4dc00c8 Ratio
BenchmarkTopologySerialization 55653 ns/op 32895 ns/op 1.69

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.