Commit Graph

13346 Commits

Author SHA1 Message Date
ionutboangiu
c356d1d796 update kafka version in role (3.7.0->3.8.0) 2024-08-19 12:12:16 +02:00
armirveliaj
0a39796581 Add unit tests on apier/v1 2024-08-19 12:10:47 +02:00
ionutboangiu
877c3df954 update rpcclient library 2024-08-19 12:10:10 +02:00
gezimblliku
58e419b002 updated trend structure && model 2024-08-16 12:32:21 +02:00
gezimblliku
b1218c4ae3 added service for trends 2024-08-16 12:32:21 +02:00
armirveliaj
4e6e1e8159 Add unit tests for trends 2024-08-16 11:34:45 +02:00
armirveliaj
f4c72b564b Add unit tests on ees 2024-08-16 11:34:45 +02:00
armirveliaj
67594abffb Add coverage tests on engine 2024-08-16 11:34:45 +02:00
armirveliaj
87648996c6 Add coverage tests on engine 2024-08-14 14:05:33 +02:00
ionutboangiu
6474c1076f update rpcclient library (#4413)
for more details: https://github.com/cgrates/rpcclient/pull/37
2024-08-14 14:04:33 +02:00
ionutboangiu
abba61723a Optimize removeFilterIndexesForFilter func (#4357)
Previously made two trips (get and set) for each group of items from
an index key being removed. Now, we fetch indexes once at the beginning
and store the updated indexes once at the end.

There was a difference compared to the previous v0.10 implementation
regarding the get/set behaviour. On v0.11, we used to get only the items
separately for each index and update only that index. Even though it
might have been more efficient, trips to the db are still too expensive
so it didn't matter much in the end.
2024-08-14 14:03:55 +02:00
gezimblliku
5b75bacff7 added trend with get,set and remove methods in datamanager 2024-08-14 14:03:21 +02:00
ionutboangiu
0748f09758 Revise troubleshooting section in docs 2024-08-13 15:07:44 +02:00
armirveliaj
6f65f09e4f Add new unit tests on engine 2024-08-12 18:37:15 +02:00
armirveliaj
e2f03ef892 Add new unit tests 2024-08-12 18:37:15 +02:00
ionutboangiu
4693983891 Update default config sample 2024-08-12 18:36:45 +02:00
ionutboangiu
b0758d082d Remove redundant http_pprof cgr-engine flag
runtime profiling is now configurable within the http cfg section and
is enabled by default
2024-08-12 18:36:45 +02:00
ionutboangiu
435ba54743 Register prometheus and pprof endpoints using https mux 2024-08-12 18:36:45 +02:00
ionutboangiu
594e8404dc Add http pprof_path cfg option 2024-08-12 18:36:45 +02:00
ionutboangiu
73fc386036 Add stordb pgSSLCertMode option 2024-08-12 18:36:45 +02:00
arberkatellari
9a79b092a5 Add exporter id within the *vars in EEs for templates 2024-08-12 18:34:01 +02:00
ionutboangiu
6079fb23bc Update default config sample 2024-08-09 09:24:04 +02:00
armirveliaj
0d78fb878c Add coverage tests on agents and services 2024-08-09 09:18:46 +02:00
armirveliaj
2f9f07a976 Add new unit tests on ees and ers 2024-08-09 09:18:46 +02:00
arberkatellari
0bab7d5557 Add reader id within the *vars in ERs 2024-08-09 09:14:24 +02:00
ionutboangiu
13ad7f3603 Slightly improve alignment inside config_defaults file 2024-08-09 09:13:10 +02:00
ionutboangiu
ca438d91cb Update postgres driver version 2024-08-09 09:13:10 +02:00
ionutboangiu
d0183597f1 Add postgres stor_db SSL opts 2024-08-09 09:13:10 +02:00
armirveliaj
ea149965ae Add new unit tests on services 2024-08-06 23:05:46 +02:00
armirveliaj
5905b54f7f Add new unit tests on loaders 2024-08-06 23:05:46 +02:00
arberkatellari
7ca9d89fbe Revize session_indexes 2024-08-06 23:04:58 +02:00
ionutboangiu
48b13c919b Complete monitoring ansible playbook
- add dashboard provisioning for grafana
- add README file
2024-08-06 08:48:36 +02:00
ionutboangiu
6c9b5d2908 Add monitoring ansible playbook 2024-08-05 13:28:33 +02:00
ionutboangiu
78e020e2be Implement HTTP endpoint for prometheus
configurable via 'prometheus_url' option in the HTTP section
2024-08-05 13:28:33 +02:00
ionutboangiu
cc25eae687 Add node_exporter ansible role 2024-08-05 13:28:33 +02:00
ionutboangiu
76b7be1adc Add grafana ansible role 2024-08-05 13:28:33 +02:00
ionutboangiu
398aa2a2a6 Add prometheus ansible role 2024-08-05 13:28:33 +02:00
gezimblliku
59b61f2354 added janusagent documentation 2024-08-04 21:12:01 +02:00
gezimblliku
22b96ca1e3 added tests for filter statmetric 2024-08-04 21:10:50 +02:00
armirveliaj
3d9a94c5c5 Add new unit tests 2024-08-04 21:04:41 +02:00
arberkatellari
8ed6d8352f Allow CORS on httpagent 2024-08-02 10:25:03 +02:00
armirveliaj
96e940cab3 Add new unit tests on janusagent 2024-08-02 09:36:54 +02:00
armirveliaj
29524f9be4 Add new unit tests on migrator 2024-08-02 09:36:54 +02:00
armirveliaj
f6f49f47a2 Add new unit tests on engine 2024-08-02 09:36:54 +02:00
armirveliaj
35af82ef18 Add new unit tests on agents 2024-08-02 09:36:54 +02:00
ionutboangiu
63129feb4c prevent memprof file overwrites for small intervals
Previously, the timestamp was accurate only down to seconds. For smaller intervals,
this would truncate the previous file(s). Now, for small intervals, the number of
microseconds is appended to the file name.

Added the possibility to disable timestamps in the memory profile file names and use
increments of 1 instead.

Updated the memory profiling integration tests.
2024-08-02 09:35:36 +02:00
ionutboangiu
218ad92635 Ensure reference fileCPU is not overwritten
Would previously happen if memory profiling was already started.
Now using os.File.Stat beforehand to check if a handler of the file
is already active and confirm the status of profiling. This required
changing the type of the reference fileCPU from io.Closer to *os.File.
Asserting the type would have worked as well.
2024-08-02 09:35:36 +02:00
ionutboangiu
1c490a9020 Revise memory profiling implementation
- 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
2024-08-02 09:35:36 +02:00
ionutboangiu
9d4561f79c Revise CPU Profiling implementation
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 io.Closer (as opposed to an io.WriteCloser)
- 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

- improved comments and error messages
2024-08-02 09:35:36 +02:00
ionutboangiu
6f4d2144a6 Add test & constant for set_versions flag
Also added set_versions help entry to cgr-engine doc.
2024-08-02 09:35:36 +02:00