Giter Club home page Giter Club logo

onsdigital.dp-frontend-filter-dataset-controller's Introduction

dp-frontend-filter-dataset-controller

An HTTP service for the controlling of data relevant to the filtering of a particular dataset.

Configuration

Environment variable Default Description
BIND_ADDR :20001 The host and port to bind to.
RENDERER_URL http://localhost:20010 The URL of dp-frontend-renderer.
CODE_LIST_API http://localhost:22400 The URL of the code list api
FILTER_API_URL http://localhost:22100 The URL of the filter api
DATASET_API_URL http://localhost:22000 The URL of the dataset api
HIERARCHY_API_URL http://localhost:22600 The URL of the hierarchy api
SEARCH_API_URL http://localhost:23100 The URL of the search api
DOWNLOAD_SERVICE_URL http://localhost:23600 The URL of the download service
ZEBEDEE_URL http://localhost:8082 The url of the zebedee service. Only required if profiler is enabled
DATASET_API_AUTH_TOKEN n/a The token used to access the Dataset API
FILTER_API_AUTH_TOKEN n/a The token used to access the Filter API
SEARCH_API_AUTH_TOKEN n/a The token used to access the Search API
ENABLE_DATASET_PREVIEW false Flag to add preview of dataset to output page
ENABLE_PROFILER false Flag to enable go profiler
PPROF_TOKEN "" The profiling token to access service profiling
GRACEFUL_SHUTDOWN_TIMEOUT 5s The graceful shutdown timeout in seconds
HEALTHCHECK_INTERVAL 30s The time between calling healthcheck endpoints for check subsystems
HEALTHCHECK_CRITICAL_TIMEOUT 90s The time taken for the health changes from warning state to critical due to subsystem check failures

HEALTHCHECK_INTERVAL and HEALTHCHECK_CRITICAL_TIMEOUT can use the following formats to represent duration of time:

"300ms" = 300 milliseconds
"1.5h" =  1.5 hours
"2h45m" = 2 hours 45 minutes

Valid time units are 
"ns" = nanosecond
"us" (or "µs") = microsecond
"ms" = millisecond
"s" = second
"m" = minute
"h" = hour

Profiling

An optional /debug endpoint has been added, in order to profile this service via pprof go library. In order to use this endpoint, you will need to enable profiler flag and set a PPROF_TOKEN:

export ENABLE_PROFILER=true
export PPROF_TOKEN={generated uuid}

Then you can us the profiler as follows:

1- Start service, load test or if on environment wait for a number of requests to be made.

2- Send authenticated request and store response in a file (this can be best done in command line like so: curl <host>:<port>/debug/pprof/heap -H "Authorization: Bearer {generated uuid} > heap.out - see pprof documentation on other endpoints

3- View profile either using a web ui to navigate data (a) or using pprof on command line to navigate data (b) a) go tool pprof -http=:8080 heap.out b) go tool pprof heap.out, -o flag to see various options

Contributing

See CONTRIBUTING for details

Licence

Copyright ©‎ 2017, Office for National Statistics (https://www.ons.gov.uk)

Released under MIT license, see LICENSE for details.

onsdigital.dp-frontend-filter-dataset-controller's People

Contributors

boxadesign avatar carlhembrough avatar chrysmore avatar crispioso avatar daillew avatar dandwal avatar davidsubiros avatar eldeal avatar gedge avatar janderson2 avatar jessjenkins avatar jondewijones avatar justinpjose avatar lloydgriffiths avatar mattrout92 avatar mikeadamss avatar nshumoogum avatar richard-95 avatar tgandrews avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.