Skip to main content

A python module that will check if two events are within a defined SLA.

Project description

SLA Checker

SLA Checker helps to check if an event is within the defined SLA.

Installation

pip3 install sla-checker

Usage

Input parameters:

  • event_start: when the event starts (e.g. when a trouble ticket is created)
  • event_end: when the event ends (e.g. when the trouble ticket is solved)
  • country_code (optional if working_on_holidays = True): the country code (e.g. IT)
  • minutes_to_resolve: maximum time in minutes allowed between event_start and event_end
  • opening_hours (optional if 7x24 service): define opening hours (e.g. 09:00)
  • closing_hours (optional if 7x24 service): define closing hours (e.g. 18:00)
  • working_on_sat (optional, default is False): define if Saturday is a working day
  • working_on_holidays (optional, default is False): define if Sunday and Holidays are working days

Example (7x24 service with 2 hours SLA):

sla = sla_checker.SLAChecker()
sla.check(
  event_start = datetime.datetime(2020, 12, 24, 17, 0, 0),
  event_end = datetime.datetime(2020, 12, 28, 10, 0, 1),
  country_code = "IT",
  minutes_to_resolve = 120,
)

Example (5x9 service with 2 hours SLA):

sla = sla_checker.SLAChecker()
sla.check(
  event_start = datetime.datetime(2020, 12, 24, 17, 0, 0),
  event_end = datetime.datetime(2020, 12, 28, 10, 0, 1),
  country_code = "IT",
  minutes_to_resolve = 120,
  opening_hours = "09:00",
  closing_hours = "18:00",
  working_on_sat = False,
  working_on_holidays = False,
)

Example (7x9 service with 2 hours SLA):

sla = sla_checker.SLAChecker()
sla.check(
  event_start = datetime.datetime(2020, 12, 24, 17, 0, 0),
  event_end = datetime.datetime(2020, 12, 28, 10, 0, 1),
  country_code = "IT",
  minutes_to_resolve = 120,
  opening_hours = "09:00",
  closing_hours = "18:00",
  working_on_sat = True,
  working_on_holidays = True,
)

Project details


Release history Release notifications

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for sla-checker, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size sla_checker-0.0.2-py3-none-any.whl (15.6 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size sla_checker-0.0.2.tar.gz (3.0 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page