OperationalBina / PipeRT

MIT License
11 stars 7 forks source link

Better naming for Components and Routines #14

Open itamarwilf opened 4 years ago

itamarwilf commented 4 years ago

In order to perform more informative logging and monitoring, we need to assign better names for each component and routine, and use those names in the logger format. Any ideas about what the format should be are welcome, but remember the names should remain unique across when scaling to many streams or when using multiprocessing (maybe use Redis transactions for the naming?)

VladShtompel commented 4 years ago

Currently it is the responsibility of the programmer to give appropriate names to the routines and components. This approach is error prone and is unlikely to scale well when working with multiple processes.

My idea consists of the following changes:

  1. Components and routines will be named automatically without programmer intervention
  2. Each Component\Routine ran as a process will have it's PID attached to the name
  3. Each Component\Routine "type" will know how many instances of that Component\Routine were created as thread (per process) and they will be named accordingly

Examples:

In general, if something was ran as a process it will have the PID prefix attached and if its a thread it will have a sequential number suffix (starting from the 2nd instance?)

This is achievable with the use of metaclasses and __init_subclass__. Tell me what you think @ItamarWilf

itamarwilf commented 4 years ago

Hi @VladShtompel sorry for the delay. I think it's a good suggestion, you should work it out with @MayoG because I think the manager #44 has some naming mechanism.