Update gson date format for serializing/deserializing Date in MS stats#11506
Conversation
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.20 #11506 +/- ##
=========================================
Coverage 16.17% 16.17%
- Complexity 13297 13298 +1
=========================================
Files 5656 5656
Lines 498136 498154 +18
Branches 60432 60441 +9
=========================================
+ Hits 80583 80590 +7
- Misses 408585 408589 +4
- Partials 8968 8975 +7
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 14724 |
|
@blueorangutan test |
|
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
[SF] Trillian Build Failed (tid-14113) |
|
@blueorangutan test |
|
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
There was a problem hiding this comment.
Pull Request Overview
This PR standardizes the date format for Gson serialization/deserialization across CloudStack's management server statistics functionality. The change ensures consistent date formatting when exchanging statistics data between multiple management servers.
- Updates the StatsCollector's Gson instance to use a specific date format pattern
- Applies the same date format to the global Gson configuration in GsonHelper
- Simplifies JSON deserialization by removing unnecessary TypeToken usage
Reviewed Changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| server/src/main/java/com/cloud/server/StatsCollector.java | Updates Gson initialization with date format, simplifies deserialization, and removes unused import |
| core/src/main/java/com/cloud/serializer/GsonHelper.java | Adds consistent date format to the default Gson configuration |
Comments suppressed due to low confidence (1)
server/src/main/java/com/cloud/server/StatsCollector.java:163
- [nitpick] The variable initialization change from 'null' to uninitialized is unnecessary since the variable is immediately assigned in the try block. The original initialization provided better clarity about the intended flow.
import com.cloud.vm.dao.VmStatsDao;
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✖️ debian ✔️ suse15. SL-JID 14728 |
|
code looks good @sureshanaparti , but can you update with a test procedure? (or automated test) |
…s (across multiple management servers)
34bab74 to
8a451a4
Compare
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 14953 |
weizhouapache
left a comment
There was a problem hiding this comment.
@sureshanaparti
codewise it looks good to me
the GsonHelper class is being used in many classes, need to be careful
thanks @sureshanaparti since the date format is used in many scenarios (mgmt to mgmt, mgmt to agent, acs to 3rd parties, etc), it is difficult to test if it works or breaks some functionalities, I would prefer to leave it for next release. |
upto @weizhouapache there'll be issues during deserialization when date format doesn't match. |
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 15020 |
|
@blueorangutan package |
|
@sureshanaparti a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15029 |
|
@blueorangutan package |
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✖️ el8 ✖️ el9 ✔️ debian ✖️ suse15. SL-JID 15087 |
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15092 |
|
@blueorangutan test |
|
@sureshanaparti a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
@sureshanaparti |
|
[SF] Trillian test result (tid-14384)
|
|
tested ok
|
… MS stats (apache#11506) * Update gson date format for serializing/deserializing Date in MS stats (across multiple management servers) * review * review comments, and unit tests * added unit test with different date format * Use separate Gson for MS stats serialization/deserialization
Description
This PR updates gson date format for serializing/deserializing Date in MS stats (across multiple management servers).
The DateFormat is set to default system locale if not set, and serialization/deserialization fails when management server nodes have different locale/timezones.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?