Commit Graph

54 Commits

Author SHA1 Message Date
ionutboangiu
5bf8f1756c Extract cores.Server into new commonlisteners package
Functionality is the same.
Server has been renamed to CommonListenerS.
2024-11-04 21:23:15 +01:00
ionutboangiu
66c119dba7 Consider diameter requests when limiting caps
- add possibility to pass custom Error-Message AVP to negative diameter
  answers
- negative answer is now built only when an error occurs
- remove tests that were testing behaviour with max concurrent requests 0
- add integration test specific to this change
2024-11-04 21:22:58 +01:00
gezimbll
132a2b3bf9 rankings,trends: added implementation,services and tests 2024-11-04 19:03:21 +01:00
ionutboangiu
4b427aeaf6 Revise flag names/usage descriptions 2024-11-01 15:59:39 +01:00
ionutboangiu
792bbb3aff Add set_versions flag to cgr-engine
If set to true, it sets/overwrites all versions to the
current ones.
2024-11-01 15:59:39 +01:00
ionutboangiu
ce856c7815 Add http pprof_path cfg option
Remove redundant http_pprof cgr-engine flag since runtime profiling is now
configurable within the http cfg section and is enabled by default
2024-11-01 15:59:39 +01:00
ionutboangiu
c7dbcaea03 Revise CPU/Memory profiling
CPU profiling changes:

cgr-engine.go:
- use filepath.Join instead of path.Join
- handle *CoreService.StopCPUProfiling error inside deferred function
- same with the error from *os.File.Close()

cores/core.go:
- StartCPUProfile now returns an *os.File (as opposed to an io.WriteCloser),
  because os.File.Stat is used beforehand to check if a handler of the file is
  already active and confirm the status of profiling.  Asserting the type would
  have worked as well.
- handle pprof.StartCPUProfile error and ensure file is closed before returning
- log file close error as a warning if it occurs
- return missing mandatory error with correct path field name ('DirPath')
- no need to check if fileCPU is nil for profiling status
  - pprof.StartCPUProfiling will return an error if profiling is already started
  - os.File.Close() will return ErrClosed if profiling is already stopped
- differentiate between calling StopCPUProfiling when profiling hasn't started
and when it was already stopped by returning appropriate errors

Memory profiling changes:

- merge StopChanMemProf with StopMemoryProfiling
- remove fileMEM and stopMemProf from struct and constructors
- add separate mutex for memory profiling, ensure thread safety
- handle all significant errors
- log error if StopMemoryProfiling fails during CoreS Shutdown
- ignore errors if profiling inactive in Shutdown and deferred Stop
- move validations inside V1 functions
- return error if StartMemoryProfiling already started
- return error if StopMemoryProfiling already stopped or never started
- close profiling loop on error, not the cgr-engine
- StopMemoryProfiling closes channel and profiling loop writes final profile
- rename Path to DirPath for mandatory field error
- rename memprof_nrfiles flag to memprof_maxfiles
- increase default memprof_interval
- consider MaxFiles <= 0 as unlimited
- move memory profiling logic after starting services
- use CoreService Start/StopMemoryProfiling in main
- remove final memory profile block (created by deferred Stop)
- convert MemProfiling to method on CoreService and rename to profileMemory
- use Ticker for recurrent actions instead of Timer
- compute mem_final.prof full path in StartMemoryProfiling
- suffix profile files with current time instead of numbers
- update dispatcher methods after changes
- move MemoryPrf from utils to cores, rename to MemoryProfilingParams
- add logs for starting/stopping profiling
- added the possibility to disable timestamps in the memory profile file names
  and use increments of 1 instead.

Other changes:

- improved integration tests for flags (now table tests)
- improved profiling integration tests
2024-11-01 15:59:39 +01:00
ionutboangiu
65e8128303 Implement ErSv1.RunReader api 2024-09-23 20:28:26 +02:00
gezimblliku
73a7590f1c added profiles,configs and services for trend && ranking 2024-08-02 09:37:52 +02:00
Gezim Blliku
80249e1074 implemented janusagent & added to services 2024-07-21 19:07:43 +02:00
arberkatellari
2e4d8bdcf4 Remove unnecessary LazySanityCheck 2024-01-06 17:12:02 +01:00
ionutboangiu
e5ab21def5 Implement AdminSv1 Get/RemoveCDRs APIs for CDRs
Addition of storDB to AdminSv1 was required.
2023-11-09 20:50:36 +01:00
ionutboangiu
df1dc5e838 Add StorDB service
Add StorDB to config and services.

Put back the store_cdrs option under cdrs and update the CDRs
service to depend on StorDB.

Define the StorDB interface and add a constructor for it.

Add a constructor for postgres storage.

Add a config sanity check to validate SSL modes for postgres.

Update cgr-engine to consider StorDB on startup.
2023-05-03 10:05:28 +02:00
ionutboangiu
60a4da69e0 Implement start/stop/status methods for servmanager + tests 2022-10-21 10:16:23 +02:00
adi
734776b113 Unified consts of opts 2022-10-03 18:29:24 +03:00
DanB
7c18d51581 DispatcherS with caches remote/replication in alpha stage 2022-09-19 12:03:35 +02:00
DanB
8d37467b63 Reorganising dispatcherS routeID functionality to avoid extra processing of event 2022-08-27 15:53:48 +02:00
adi
424b5bde54 Improved service for efs 2022-08-23 20:31:53 +03:00
adi
97d14b2801 concurrency efs 2022-08-23 20:31:53 +03:00
adi
107932e3d2 context and efs service starting 2022-07-30 08:19:08 +02:00
adi
a448fb2c7a INtegrated efs in logger/ees + ers changes 2022-07-30 08:19:08 +02:00
adi
da358161a7 EFs service to logger/ees and APIS 2022-07-30 08:19:08 +02:00
adi
86d2f1476a Attemtps config change 2022-07-30 08:19:08 +02:00
adi
d847ec5d98 Apid and service of efs 2022-07-19 17:15:42 +02:00
adi
8b14619fce Integrated efs 2022-07-13 19:24:50 +02:00
adi
bf870b1e2b Failover ees/loggers improved + tests 2022-07-11 17:27:46 +02:00
adi
c22f43c788 Failed posts and failover for export loggers 2022-06-29 12:00:42 +02:00
adi
63c0841b11 Implelemnted kafka logger 2022-06-29 12:00:42 +02:00
ionutboangiu
e0a0ef19f2 Update logger initialization when starting cgr-engine 2022-04-09 14:48:33 +02:00
porosnicuadrian
1e202feb5b TPExporter 2022-03-11 11:21:56 +01:00
andronache98
ecdf5e54ea Changed headers 2022-03-09 14:14:30 +01:00
andronache98
9ec56f5155 Changed headers 2022-03-09 14:14:30 +01:00
andronache98
928dbd9e42 Removing StorDB 2022-03-09 14:14:30 +01:00
andronache98
03793c0082 Removed storDB from config 2022-03-09 14:14:30 +01:00
porosnicuadrian
bdc124be1f Added dataManager and tenant in tpes 2022-03-09 11:03:16 +01:00
porosnicuadrian
cafa791a11 Changed TpeS to TPeS 2022-03-03 20:35:24 +02:00
porosnicuadrian
4de3b13c12 Added tpes infrastructure and ping method 2022-03-02 11:47:22 +02:00
Trial97
11feb738fc Updated generating script 2021-12-20 16:17:24 +01:00
ionutboangiu
dceba2e60d Update syslog init in cgr-engine for the new logger 2021-12-19 17:12:47 +01:00
porosnicuadrian
0ed0987451 Fixed subsystems to shutdown in time 2021-11-25 12:28:52 +01:00
porosnicuadrian
d4537efd02 Fixed timeout for stop engine 2021-11-25 12:28:52 +01:00
porosnicuadrian
029c04df50 Fixed *rpc ee and services 2021-10-27 19:50:07 +03:00
porosnicuadrian
bb2ad8f57f New method for CGRengine for getting dm 2021-10-27 19:50:07 +03:00
nickolasdaniel
44c41add6a Fixed tests so that now loading can be made through the AnalyzerS API 2021-10-08 11:09:55 +03:00
porosnicuadrian
287730b6cc Finished session volume discount test 2021-10-04 17:38:49 +02:00
Trial97
6a3f8ddc57 Updated config 2021-09-20 10:45:14 +02:00
Trial97
afeedae898 Updated cgr-engine new function 2021-09-15 10:06:13 +02:00
Trial97
968ba9c694 Updated cgr-engine 2021-09-15 10:06:13 +02:00
Trial97
d12cf14dbe Added example for cgrmanager 2021-09-13 16:08:39 +02:00
Trial97
0ed0b0e7a6 Updated more services 2021-09-13 16:08:39 +02:00