def segment_memory()

in osbenchmark/chart_generator.py [0:0]


    def segment_memory(title, environment, test_ex_config):
        vis_state = {
            "title": title,
            "type": "metrics",
            "params": {
                "axis_formatter": "number",
                "axis_position": "left",
                "id": str(uuid.uuid4()),
                "index_pattern": "benchmark-results-*",
                "interval": "1d",
                "series": [
                    {
                        "axis_position": "left",
                        "chart_type": "line",
                        "color": "#68BC00",
                        "fill": "0",
                        "formatter": "bytes",
                        "id": str(uuid.uuid4()),
                        "line_width": "1",
                        "metrics": [
                            {
                                "id": str(uuid.uuid4()),
                                "type": "avg",
                                "field": "value.single"
                            }
                        ],
                        "point_size": "3",
                        "seperate_axis": 1,
                        "split_mode": "filters",
                        "stacked": "none",
                        "filter": f"environment:{environment} AND workload:\"{test_ex_config.workload}\"",
                        "split_filters": [
                            {
                                "filter": "memory_segments",
                                "label": "Segments",
                                "color": color_scheme_rgba[0],
                                "id": str(uuid.uuid4())
                            },
                            {
                                "filter": "memory_doc_values",
                                "label": "Doc Values",
                                "color": color_scheme_rgba[1],
                                "id": str(uuid.uuid4())
                            },
                            {
                                "filter": "memory_terms",
                                "label": "Terms",
                                "color": color_scheme_rgba[2],
                                "id": str(uuid.uuid4())
                            },
                            {
                                "filter": "memory_norms",
                                "label": "Norms",
                                "color": color_scheme_rgba[3],
                                "id": str(uuid.uuid4())
                            },
                            {
                                "filter": "memory_points",
                                "label": "Points",
                                "color": color_scheme_rgba[4],
                                "id": str(uuid.uuid4())
                            },
                            {
                                "filter": "memory_stored_fields",
                                "label": "Stored Fields",
                                "color": color_scheme_rgba[5],
                                "id": str(uuid.uuid4())
                            }
                        ],
                        "label": "Segment Memory",
                        "value_template": "{{value}}",
                        "steps": 0
                    }
                ],
                "show_legend": 1,
                "time_field": "test-execution-timestamp",
                "type": "timeseries",
                "filter": TimeSeriesCharts.filter_string(environment, test_ex_config),
                "annotations": [
                    {
                        "fields": "message",
                        "template": "{{message}}",
                        "index_pattern": "benchmark-annotations",
                        "query_string": f"((NOT _exists_:workload) OR workload:\"{test_ex_config.workload}\") "
                                        f"AND ((NOT _exists_:chart) OR chart:segment_memory) "
                                        f"AND ((NOT _exists_:chart-name) OR chart-name:\"{title}\") AND environment:\"{environment}\"",
                        "id": str(uuid.uuid4()),
                        "color": "rgba(102,102,102,1)",
                        "time_field": "test-execution-timestamp",
                        "icon": "fa-tag",
                        "ignore_panel_filters": 1
                    }
                ],
                "show_grid": 1,
                "drop_last_bucket": 0,
                "axis_min": "0"
            },
            "aggs": []
        }

        return {
            "id": str(uuid.uuid4()),
            "type": "visualization",
            "attributes": {
                "title": title,
                "visState": json.dumps(vis_state),
                "uiStateJSON": "{}",
                "description": "segment_memory",
                "version": 1,
                "kibanaSavedObjectMeta": {
                    "searchSourceJSON": "{\"query\":{\"query\":\"*\",\"language\":\"lucene\"},\"filter\":[]}"
                }
            }
        }