#1 2018-06-11 08:33:52

DigDiver
Member
Registered: 2013-04-29
Posts: 137

StatsAsJson([withTables,withMethods]) missing Text in json output

In the previous version the  StatsAsJson method returns:

    "LastTime": {
      "MicroSec": 2644,
      "Text": "2.64ms"
    },
    "MinimalTime": {
      "MicroSec": 7,
      "Text": "7us"
    },
    "AverageTime": {
      "MicroSec": 18995,
      "Text": "18.99ms"
    },

In the new version (missing "Text"):

    "LastTime": {
      "MicroSec": 58
    },
    "MinimalTime": {
      "MicroSec": 11
    },
    "AverageTime": {
      "MicroSec": 1054
    },
    "MaximalTime": {
      "MicroSec": 121127
    },...

Offline

#2 2018-06-11 09:05:19

DigDiver
Member
Registered: 2013-04-29
Posts: 137

Re: StatsAsJson([withTables,withMethods]) missing Text in json output

Property Text has type shortstring

procedure TJSONSerializer.WriteObject(Value: TObject; Options: TTextWriterWriteObjectOptions);
...
  procedure WriteProp(P: PPropInfo);
...
    Kind := P^.PropType^.Kind;  <- for property "Text" Kind is tkString. And tkString is not handled in the code below
    case Kind of

Offline

#3 2018-06-11 13:46:48

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,670
Website

Re: StatsAsJson([withTables,withMethods]) missing Text in json output

You are right- this was a regression from previous behavior.

Please check https://synopse.info/fossil/info/13e36ea96e

Thanks for the feedback!

Offline

Board footer

Powered by FluxBB