Skip to content

jean1042/statistics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SpaceONE Statistics Service

run celery beat

cd src && spaceone celery spaceone.statistics -m . -c ./spaceone/statistics/conf/worker.yaml 
./spaceone/statistics/conf/beat.yaml # beat config

Beat server config example

GLOBAL:
  DATABASES:
    default:
      db: 'test_stat_celery'
      host: 127.0.0.1
      port: 27017
      username: ''
      password: ''
  ENDPOINT:
    celery:
      endpoint: "localhost:50051"
      version: v1
  CACHES:
    default:
      backend: spaceone.core.cache.redis_cache.RedisCache
      host: localhost
      port: 6379
      db: 1
      encoding: utf-8
      socket_timeout: 10
      socket_connect_timeout: 10

  TOKEN: xxx.xxx.xxx # spaceon token
  
  LOG:
    loggers:
      spaceone:
        handlers:
          - console
          - file
      celery: # please set celery logger
        handlers:
          - console
          - file
  CELERY:
    mode: BEAT
    config:
      broker_url: redis://localhost:6379 
    schedules:
      stat_scheduler:
        task: spaceone.statistics.task.stat_hourly_scheduler.stat_hour_scheduler
        rule_type: interval
        rule:
          period: hours
          every: 1

run celery worker

cd src && spaceone celery spaceone.statistics -m . -c ./spaceone/statistics/conf/worker.yaml 
./spaceone/statistics/conf/worker.yaml # worker config

worker server config example

GLOBAL:
  DATABASES:
    default:
      db: 'test_stat_celery'
      host: 127.0.0.1
      port: 27017
      username: ''
      password: ''
  ENDPOINT:
    celery:
      endpoint: "localhost:50051"
      version: v1
  CACHES:
    default:
      backend: spaceone.core.cache.redis_cache.RedisCache
      host: localhost
      port: 6379
      db: 1
      encoding: utf-8
      socket_timeout: 10
      socket_connect_timeout: 10

  TOKEN: xxx.xxx.xxx # spaceon token
  
  LOG:
    loggers:
      spaceone:
        handlers:
          - console
          - file

  CELERY:
    mode: WORKER
    config:
      broker_url: redis://localhost:6379

About

SpaceONE Statistics Service

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 98.4%
  • Mustache 1.2%
  • Dockerfile 0.4%