All Downloads are FREE. Search and download functionalities are using the official Maven repository.

freemarker.healthcheck.avg-response-time.ftl Maven / Gradle / Ivy

There is a newer version: 4.5.2
Show newest version
<#ftl output_format="JSON">
{
    "size": 0,
    "query": {
        "bool": {
            "filter": [
                {
                    "term": {
                        "api": "${query.root().id()}"
                    }
                }
            ]
        }
    },
    "aggregations": {
        "terms": {
            "aggregations": {
                "ranges": {
                    "aggregations": {
                        "results": {
                            "avg": {
                                "field": "response-time"
                            }
                        }
                    },
                    "date_range": {
                        "field": "@timestamp",
                        "keyed": false,
                        "ranges": [
                            {
                                "from": "now-1m",
                                "key": "1m"
                            },
                            {
                                "from": "now-1h",
                                "key": "1h"
                            },
                            {
                                "from": "now-1d",
                                "key": "1d"
                            },
                            {
                                "from": "now-1w",
                                "key": "1w"
                            },
                            {
                                "from": "now-1M",
                                "key": "1M"
                            }
                        ]
                    }
                }
            },
            "terms": {
                "field" : "${query.field()?lower_case}",
                "order": [
                    {
                        "_count": "desc"
                    },
                    {
                        "_key": "asc"
                    }
                ],
                "size": 100
            }
        }
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy