Legacy Dev Forum Posts

 View Only

Sign Up

Edge metrics / Trunk metrics deserialization issue

  • 1.  Edge metrics / Trunk metrics deserialization issue

    Posted 06-05-2025 18:19

    Benjamin_Guenard | 2021-03-26 15:26:16 UTC | #1

    I m trying to use edge metrics and trunk metrics notification but i received the following error

    Newtonsoft.Json.JsonSerializationException: Error converting value 03/26/2021 15:21:06 to type 'PureCloudPlatform.Client.V2.Model.EdgeMetricsTopicOffsetDateTime'. Path 'eventBody.eventTime', line 1, position 207.


    System.ArgumentException: Could not cast or convert from System.DateTime to PureCloudPlatform.Client.V2.Model.EdgeMetricsTopicOffsetDateTime.

    I m using .NET framework.


    anon11147534 | 2021-03-26 15:35:25 UTC | #2

    Hi,

    Looks like a bug in the SDK. We'll apply a bug fix for it. Keep an eye on the releases for the fix.


    Benjamin_Guenard | 2021-03-27 15:51:52 UTC | #3

    Found other bugs in EdgeMetricsTopicEdgeMetricMemory & EdgeMetricsTopicEdgeMetricDisk. Integer must be changed by double, int is too small.


    anon11147534 | 2021-03-29 08:25:03 UTC | #4

    Thanks for the info. I'll apply those fixes also


    anon11147534 | 2021-03-30 14:37:17 UTC | #5

    Hi Benjamin,

    I've looked into the 2 bugs you reported. It appears that the DateTime issue is due to a variable being removed from a notification model schema. Currently, updates to model schemas don't trigger SDK builds - We will update our SDK build process to respond to notification schema changes in future. The Integer overflow error is due to an incorrect schema given for that notification topic. I've reported it to the team responsible for that API. Keep an eye on the SDK releases for the bug fix.


    Benjamin_Guenard | 2021-03-31 11:30:18 UTC | #6

    Hi Ronan, i tested latest release, first issue has been fixed but I still have errors with some int properties. Does this mean that there are no tests performed to validate a patch ?

    Benjamin


    anon11147534 | 2021-03-31 12:01:04 UTC | #7

    Hi Benjamin,

    The latest version unfortunately doesn't contain that particular fix. I reported the bug to the developers but they haven't begun work on it yet. In the meantime, you could clone and build the SDK locally with the necessary changes. To do that:

    1. Clone https://github.com/MyPureCloud/platform-client-sdk-dotnet
    2. Change the references to AvailableBytes and TotalBytes to doubles in EdgeMetricsTopicEdgeMetricDisk.cs and EdgeMetricsTopicEdgeMetricMemory.cs

    I'm on a Mac and I use the following command to build the SDK:

    mcs -r:./build/bin/Newtonsoft.Json.dll,\
    ./build/bin/RestSharp.dll,\
    ./build/bin/websocket-sharp.dll,\
    System.Runtime.Serialization.dll \
    -target:library \
    -out:./build/bin/PureCloudPlatform.Client.V2.dll \
    -doc:./build/bin/PureCloudPlatform.Client.V2.xml \
    -recurse:'./build/src/'PureCloudPlatform.Client.V2'/*.cs' \
    -platform:anycpu

    The resulting dll will be built to ./build/bin/PureCloudPlatform.Client.V2.dll.

    I'm not sure what steps are needed if you're using a Windows machine but I imagine visual studio has built-in support for it.

    I hope this helps.

    Ronan


    system | 2021-05-01 12:01:06 UTC | #8

    This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.


    This post was migrated from the old Developer Forum.

    ref: 10426