visitCountChanges


URI

<portalStatistics_uri>/resource/visit/countchanges[.<format>]

Supported methods

GET, HEAD

Parent resource

portalStatistics

Introduction

The visitCountChanges resource is the number of visits to a resource for a resource type. By sending the GET request, it can get the number of visits to a resource for a resource type. Currently, you can get the accessing number to the map and service resources in the portal. For this function, you need to enable the service agent function and the service agent accessing statistics function.

Supported Methods:

Supported output formats: rjson, json, html, xml.

Resource hierarchy

HTTP request methods

Implement the HTTP request on the following URI, where supermapiportal is the server name, with rjson being the output format.

http://supermapiportal:8090/iportal/manager/portalstatistics/resource/visit/countchanges.rjson

GET request

Get the number of visits to a resource for a resource type.

Request parameter

When sending the request, it needs to include the following parameters in the request entity, and the request parameters should be contained in URI.

Name Type Description
resourceType ResourceType [Required] Resource type. Currently supports MAP (map resources), SERVICE (Service resources).
resourceIds List<Integer> [Required] Resource id array.
startTime Long [Optional] The start time of the access information records. If it is not positive number, it will be queried from the earliest record. It is the value in millisecond of the time since 00:00:00 GMT January 1, 1970.
endTime Long [Optional] The end time of the access information records. If it is not positive number or not set, it will take the current server time as the end time. It is the value in millisecond of the time since 00:00:00 GMT January 1, 1970.
intervalType IntervalType [Optional] Statistical time interval, if this parameter is not set, the system will calculate a more reasonable time interval for statistics.

Response structure

Perform GET request on the visitCountChanges resource to get the number of visits to several resources for a resource type. Where the single resource accessing number information consists of the following fields:

Field Type Description
resourceId Integer The ID of the resource.
resourceName String The resource name.
visitCountInfos List<VisitCountInfo> The resource accessing number information.

Response example

Count the total number of accessing the service whose id is 3 over a period of time, the time interval is hour, you need to set resourceType=SERVICE&startTime=1494172800000&endTime=1494212997508&intervalType=HOUR. The returned rjson format representation after implementing the GET request on the visitCountChanges resource http://localhost:8090/iportal/manager/portalstatistics/resource/visit/countchanges.rjson?resourceType=SERVICE&resourceIds=[3]&startTime=1494172800000&endTime=1494212997508&intervalType=HOUR is as follows:

[

    {

        "resourceId": 3,

        "resourceName": "China",

        "visitCountInfos": [

            {

                "endTime": 1494176399999,

                "startTime": 1494172800000,

                "visitCount": 0

            },

            {

                "endTime": 1494179999999,

                "startTime": 1494176400000,

                "visitCount": 0

            },

            {

                "endTime": 1494183599999,

                "startTime": 1494180000000,

                "visitCount": 0

            },

            {

                "endTime": 1494187199999,

                "startTime": 1494183600000,

                "visitCount": 0

            },

            {

                "endTime": 1494190799999,

                "startTime": 1494187200000,

                "visitCount": 0

            },

            {

                "endTime": 1494194399999,

                "startTime": 1494190800000,

                "visitCount": 0

            },

            {

                "endTime": 1494197999999,

                "startTime": 1494194400000,

                "visitCount": 0

            },

            {

                "endTime": 1494201599999,

                "startTime": 1494198000000,

                "visitCount": 0

            },

            {

                "endTime": 1494205199999,

                "startTime": 1494201600000,

                "visitCount": 0

            },

            {

                "endTime": 1494208799999,

                "startTime": 1494205200000,

                "visitCount": 0

            },

            {

                "endTime": 1494212399999,

                "startTime": 1494208800000,

                "visitCount": 2

            },

            {

                "endTime": 1494212997508,

                "startTime": 1494212400000,

                "visitCount": 4

            }

        ]

    }

]

HEAD request

Returns the same HTTP response header as the GET request, but does not have the response entity. It can get the metadata information in the response header without transferring the whole response content. Metadata information includes media type, character encoding, compression encoding, entity content length, and so on.

The HEAD request can be used to determine whether the visitCountChanges resource exists or whether the client has authority to access the resource. It can quickly determine whether the visitCountChanges resource supports the representation in <format> format by performing HEAD request on URI with <format>.

See