¿Where should the Statistics Collector policy be located? (produces null data in report) ?

The one (only) "Statistics Collector" policy that I had in my proxy server, I have now moved to this new location: in the RESPONSE flow of "PostFlow" within "Default" in "Proxy Endpoints"; but now the report that I have created does not show correct data: before it showed correct values and now it generates "null" values. ¿Can someone please confirm if this policy can be located here where I currently have it (within "Proxy Endpoints" within "default" in the Response flow of "PostFlow") ?.

The “Extract-Variables” policy was left in the same place where it was previously: in the Response flow of the element that sends the request and produces the original data. This element that generates the data is inside "Proxy Endpoints" inside "default".

The location of the "Statistics Collector" policy I changed it because I need to collect also statistical data generated by the other elements, these elements are also inside "Proxy Endpoints" within "default", so as not to use a pair of policies for each of these elements (one of "Extract Variables" and another of "Statistics Collector"), but one of "Extract Variables" for each element and only one of "Statistics Collector" for all the elements; because according to the documentation I understand that no more than one "Statistics Collector" policy should be used in a proxy.

------------------------------------------------------------

The "Extract Variables" code in its part of <JSONPayload> I have it like this:

<Variable name="ReportExecute_apiid_id">

<JSONPath>$.apiid.id</JSONPath>

</Variable>

------------------------------------------------------------

The "Statistics Collector" code in your part of <Statistics> I have it like this:

<Statistic name="datahub_ReportExecute_apiid_id" ref="ReportExecute_apiid_id" type="String">APIID</Statistic>

------------------------------------------------------------

The report now looks like this:

<image.png> (my apologies, the image did not go up)

The data I generated after having moved the "Statistics Collector" policy are the 4 located at 12:00 (on the right). The rest of the data, the 6 located at 15:00 and the 5 at 12:00 (on the left), had been generated when the data was well displayed; but those data that previously showed well now also groups them as "null".

¿Could it be that I am misplacing the "Statistics Collector" policy ?, or ¿to collect statistics of different elements should I be given a different management than the one I am giving ?. ¿Could someone please help me to overcome this issue ?.

Solved Solved
0 2 476
1 ACCEPTED SOLUTION

Putting the StatisticsCollector policy in the PostFlow in your Proxyendpoint should work fine, IF you do not use a RaiseFault to return a message to the caller, and IF there is no other fault raised.

To troubleshoot,

  1. verify that the extractvariables works a you expect. Verify that the variable is set as you expect. You can do this by examining the trace UI.
  2. Verify that the variable remains set at the time the StatisticsCollector policy runs. You can do this by using an AssignVariable AFTER the statisticscollector to assign ReportExecute_apiid_id to another variable of any name. This will show in the Trace output.

    <AssignMessage name='AM-Diagnostics'>
      <AssignVariable>
        <Name>anything</Name>
        <Ref>ReportExecute_apiid_id</Ref>
      </AssignVariable>
    </AssignMessage>
    

View solution in original post

2 REPLIES 2

Putting the StatisticsCollector policy in the PostFlow in your Proxyendpoint should work fine, IF you do not use a RaiseFault to return a message to the caller, and IF there is no other fault raised.

To troubleshoot,

  1. verify that the extractvariables works a you expect. Verify that the variable is set as you expect. You can do this by examining the trace UI.
  2. Verify that the variable remains set at the time the StatisticsCollector policy runs. You can do this by using an AssignVariable AFTER the statisticscollector to assign ReportExecute_apiid_id to another variable of any name. This will show in the Trace output.

    <AssignMessage name='AM-Diagnostics'>
      <AssignVariable>
        <Name>anything</Name>
        <Ref>ReportExecute_apiid_id</Ref>
      </AssignVariable>
    </AssignMessage>
    

Thanks for the reply. Yes, I see that it is, because it works for me, but it started to work for me after several days. I still do not understand why it took so long to start showing the information well in the graphics, but it works.