Skip to content

Instantly share code, notes, and snippets.

@fernandor777
Last active July 5, 2018 12:57
Show Gist options
  • Save fernandor777/5367c05930c53216f7c03c6886dff61e to your computer and use it in GitHub Desktop.
Save fernandor777/5367c05930c53216f7c03c6886dff61e to your computer and use it in GitHub Desktop.
qos_proposal.md

Quality of Service module design: QoS WMS/WFS GetCapabilities Extension

Overview

Allow GeoServer extends WMS/WFS GetCapabilities with optional QoS elements.

Proposed By

Fernando Miño

Assigned to Release

This proposal is for GeoServer 2.14-beta.

State

  • Under Discussion
  • In Progress
  • Completed
  • Rejected
  • Deferred

Motivation

The QoSE DWG has been discussing over the last year a number of extensions to standard GetCapabilities documents for various OGC services in order to enable and guide automatic QoS testing for OGC services endpoints while retaining the ability to safely ignore such extension for non QoS oriented clients.

Such extensions would cover the following:

  • Operating Info
    • Operational status (test/demo/beta/production etc.)
    • Operating days & hours (default: 24/7)
  • Scheduled maintenance
    • Regular maintenance windows, upcoming planned downtime events
  • QoS statements applying to the entire service
    • Metrics & minimum values to be expected, availability, capacity etc.
  • Representative operations
    • QoS statements for given operations & limited request parameters
    • Intended use cases: auto-configuration for QoS monitoring tools, automatic cataloguing, generating relevant preview data for client software etc

QoS xml examples

Proposal

WMS 1.3.0 and WFS 2.0.1 Services QoS Metadata Extensions

GetCapabilities QoS Plugin extension point

QosWMSCapabilitiesProvider and QosWFSCapabilitiesProvider classes would allow to inject QoS XML metadata into qos-wms:QualityOfServiceMetadata & qos-wfs:QualityOfServiceMetadata extended tags. Plugin would register a spring-bean for both classes.

qos-wms:QualityOfServiceMetadata and qos-wfs:QualityOfServiceMetadata extended tags and its internal metadata tags will be located in standard substitution place of _ExtendedCapabilities.

QoS WMS GetCapabilities extension point:

package org.geoserver.qos.wms;

import org.geoserver.ExtendedCapabilitiesProvider.Translator;
import org.geoserver.QosCapabilitiesProvider;

/**
 * QoS WMS GetCapabilities extension point
 */
public class QosWMSCapabilitiesProvider 
    implements ExtendedCapabilitiesProvider {
    ...
    void encode(Translator tx, WMSInfo wfs, GetCapabilitiesRequest request) {
        ...
    }
    
}

QoS WFS GetCapabilities extension point:

package org.geoserver.qos.wfs;

import org.geoserver.QosCapabilitiesProvider;
import org.geoserver.wfs.WFSInfo;
import org.geoserver.wfs.request.GetCapabilitiesRequest;

/**
 * QoS WFS extension point
 *
 */
public class QosWFSCapabilitiesProvider 
        implements ExtendedCapabilitiesProvider {
    ...
    void encode(Translator tx, WFSInfo serviceInfo, GetCapabilitiesRequest request){
        ...
    }
}

QoS Extensions bean DI:

Spring ApplicationContext bean definition:

    <bean id="wmsQosMetadata" class="org.geoserver.qos.wms.QosWMSCapabilitiesProvider">
    </bean>
    
    <bean id="wfsQosMetadata" class="org.geoserver.qos.wfs.QosWFSCapabilitiesProvider">
    </bean>
    

QoS OperatingInfo XML metadata encoded:

<qos-wms:QualityOfServiceMetadata>
...
    <qos:OperatingInfo>
        <qos:OperationalStatus xlink:href="http://def.opengeospatial.org/codelist/qos/status/1.0/operationalStatus.rdf#Operational" xlink:title="Operational" />
        <qos:ByDaysOfWeek>
            <qos:On>Monday Tuesday Wednesday Thursday Friday</qos:On>
            <qos:StartTime>06:00:00+03:00</qos:StartTime>
            <qos:EndTime>17:59:59+03:00</qos:EndTime>
        </qos:ByDaysOfWeek>
        <qos:ByDaysOfWeek>
            <qos:On>Saturday</qos:On>
            <qos:StartTime>10:00:00+03:00</qos:StartTime>
            <qos:EndTime>14:59:59+03:00</qos:EndTime>
        </qos:ByDaysOfWeek>
    </qos:OperatingInfo>
...
</qos-wms:QualityOfServiceMetadata>

Internal storage

Persisting configuration data will be stored on qos.xml config file, located on global/workspace directory, using Xstream library for serialization/deserialization to java objects.

GUI additions

Web UI QoS metadata configuration

The following UI elements will be inserted on Service Configuration Interfaces (WMS and WFS) at global and workspace level(for virtual services qos metadata).

QoS activation on Service / Workspace

activation

Operational Info:

operational info

QoS Statements:

statements

Anomaly Feed:

anomaly feed

Representative Operations:

layers area

QoS WMS Rest API

  • [GET] /qos/wms/ : get global OWS QoS configuration
  • [PUT] /qos/wms/ : modify global OWS QoS configuration
  • [DELETE] /qos/wms/ : Disable global OWS QoS
  • [GET] /workspaces/{workspace}/qos/wms/ : get workspace OWS QoS configuration
  • [PUT] /workspaces/{workspace}/qos/wms/ : modify workspace OWS QoS configuration
  • [DELETE] /workspaces/{workspace}/qos/wms/ : disable workspace OWS QoS

QoS WFS Rest API

  • [GET] /qos/wfs/ : get global OWS QoS configuration
  • [PUT] /qos/wfs/ : modify global OWS QoS configuration
  • [DELETE] /qos/wfs/ : Disable global OWS QoS
  • [GET] /workspaces/{workspace}/qos/wfs/ : get workspace OWS QoS configuration
  • [PUT] /workspaces/{workspace}/qos/wfs/ : modify workspace OWS QoS configuration
  • [DELETE] /workspaces/{workspace}/qos/wfs/ : disable workspace OWS QoS

QoS WMS rest configuration Example (st workspace):

[PUT] /workspaces/{workspace}/qos/wms/

{
    qosEnabled: true,
    operatingInfo: {
        operationalStatus: {
            href: "http://def.opengeospatial.org/codelist/qos/status/1.0/operationalStatus.rdf#Operational",
            title: "Operational"
        },
        daysOfWeek: [
            { 
                on: [ "Monday", "Tuesday", "Wednesday", "Thursday", "Friday" ],
                startTime: "06:00:00+03:00",
                endTime: "17:59:59+03:00"
            },
            { 
                on: [ "Saturday" ],
                startTime: "10:00:00+03:00",
                endTime: "14:59:59+03:00"
            }
        ]
    },  // end operationalInfo
    qualityOfServiceStatements: [
        {   
            metricHref: "http://def.opengeospatial.org/codelist/qos/metrics/1.0/metrics.rdf#AvailabilityMonthly",
            metricTitle: "Monthly service availability",
            moreThanOrEqual: {
                uom: "%",
                value: 99.5
            }
        },
        {   
            metricHref: "http://def.opengeospatial.org/codelist/qos/metrics/1.0/metrics.rdf#RequestCapacityPerSecond",
            metricTitle: "Service capacity, requests per second",
            moreThanOrEqual: {
                uom: "s-1",
                value: 54
            }
        }
    ],
    representativeOperation: {
        getMapOperations:[
            {
                DCP: "ows:HTTP/ows:Get",
                requestOption:{
                    areaConstraint: {
                        srsName: "EPSG:3067",
                        lowerCorner: "64934.103000 6626229.791000",
                        upperCorner: "732333.567000 7776461.100000"
                    },
                    layerName: ["Guayaquil", "Quito"],
                    CRS: "EPSG:3067",
                    imageWidth: {
                        max: 256
                    },
                    imageHeight: {
                        max: 256
                    },
                    outputFormat: [
                        "image/png", "image/jpeg"
                    ]
                }
            }
        ],
        qualityOfServiceStatement: {
            metricHref: "http://def.opengeospatial.org/codelist/qos/metrics/1.0/metrics.rdf#InitialResponsePerformance",
            metricTitle: "Initial response performance",
            lessThanOrEqual: {
                uom: "ms",
                value: 500
            }
        }
    },
    operationAnomalyFeed: {
        href: "myservice.ics",
        abstract: "A iCalendar (rfc5545) feed for operation anomalies considering this service",
        format: "text/calendar"
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment