Commit Graph

2937 Commits

Author SHA1 Message Date
ionutboangiu
a3d385dd2f revise comments in trends 2025-03-10 13:49:34 +01:00
ionutboangiu
c762de5c28 move rankings to dedicated package 2025-03-10 13:49:34 +01:00
ionutboangiu
47fb25b4ef move trends to dedicated package
reivse/add comments and order of funcs/definitions
2025-03-10 13:49:34 +01:00
ionutboangiu
2c8c9b326e remove previous prometheus integration 2025-03-09 17:27:31 +01:00
ionutboangiu
875fdb3993 implement config object for prometheus_agent 2025-03-09 17:27:31 +01:00
ionutboangiu
47fb574aef revise failing integration test
failing due to 56dfa4ee21
warning error is not returned anymore, only logged
2025-02-26 19:52:58 +01:00
ionutboangiu
56dfa4ee21 prevent data race in file watcher goroutine 2025-02-26 16:19:08 +01:00
gezimbll
8fd871b304 added log level field on stordb opts for controlling sql verbosity 2025-02-25 19:42:11 +01:00
ionutboangiu
deaf5f4918 Move config/objdp.go to utils package
and rename the file to objectdp.go
2025-02-24 13:36:32 +01:00
ionutboangiu
3254e0d35f Export RSRParser Path field
configsanity and its tests need access to it
2025-02-24 13:36:32 +01:00
ionutboangiu
b1a5874215 Move config/rsrparser.go to utils package 2025-02-24 13:36:32 +01:00
ionutboangiu
36a7d174ab Remove RSRSep opt from general section
- allows RSRParser to be split gracefully from config (was depending on
  RSRSep, which was retrieved from the global config variable)
- default separator (;) was the only one used except for splitting
  inline attribute values (where ANDSep is used)
2025-02-24 13:36:32 +01:00
ionutboangiu
712aeb0d4a Revise StateDeps implementation
Now tracks states by passing around an empty struct as a signal to
states defined on the service, as opposed to signal state changes by
closing the channel. This makes sure services can only be in one
state at once and allows for multiple state changes which were not
possible before.
2025-02-07 13:23:59 +01:00
gezimbll
df3dcfb840 replaced CGREvent parameter to DataProvider for GetOpts functions 2025-02-07 13:18:43 +01:00
gezimbll
3ebf3007a5 added startdelay config option for ers readers 2025-01-29 14:44:28 +01:00
ionutboangiu
ea25caa9fb Add missing els clone and AsMapIface logic 2025-01-29 10:52:24 +01:00
ionutboangiu
9b9c7bb914 Make elasticsearch refresh opt configurable 2025-01-29 10:52:24 +01:00
ionutboangiu
c1331531a7 Remove unusable elasticsearch opts 2025-01-29 10:52:24 +01:00
armirveliaj
a05834af81 Adding *accountsForceUsage variables for GetBoolOpts 2025-01-29 10:49:15 +01:00
armirveliaj
cae468454c Adding *sessionSOriginID StringOpts variables 2025-01-29 10:49:15 +01:00
armirveliaj
7db65ca62c Clean up DispatcherS 2025-01-17 17:29:46 +01:00
ionutboangiu
6be26def4f Implement CapService 2025-01-16 15:51:52 +01:00
ionutboangiu
04f746c634 Implement LoggerService + refactoring (incomplete) 2025-01-14 19:00:37 +01:00
ionutboangiu
e7152dacf8 Implement ConnManager service
Use it to register internal rpc conns instead of ServManager
DispatcherS now waits for AttributeS to start (only when enabled)
2025-01-14 19:00:37 +01:00
ionutboangiu
dab152f976 Integrate StateServiceDOWN + registry related refactor
Removed redundant IsRunning service method
Removed registry from constructors
Pass registry to Start/Reload/Shutdown service methods
2025-01-14 19:00:37 +01:00
ionutboangiu
17405af987 Revise service manager logs
Logging is now done as ServiceManager level. Removed any other logs.
2025-01-10 20:18:08 +01:00
DanB
4025e5a34b Sessions struct changes 2025-01-10 20:14:45 +01:00
gezimbll
2b04066504 added parsing the event for *usage opts in accounts 2025-01-10 12:31:44 +01:00
DanB
39952a3388 SessionS Authorize and ProcessCDR methods tested 2024-12-30 19:55:42 +01:00
DanB
c034868c43 debit and newBalanceOperators only works with abstract and concrete balances, ignore the rest 2024-12-23 17:47:26 +01:00
armirveliaj
8921bf8b99 Revise && add new unit tests 2024-12-20 18:01:15 +01:00
DanB
3c57a8ddca Properly name Values instead of Value within DynamicStringSliceOpt 2024-12-19 16:01:31 +01:00
DanB
476f5ba877 Services with IntRPCConn method 2024-11-30 19:13:19 +01:00
DanB
6b241ee35b Adding serviceIndexer and StateDependencies 2024-11-28 14:56:03 +01:00
DanB
3b195dcf1d Adding StateIndexer, ServiceIndexer, StateDeps 2024-11-23 20:14:07 +01:00
gezimbll
1c6c733a3f added dispatcher methods for rankings and trends 2024-11-22 20:29:27 +01:00
gezimbll
bb0116c543 added it test && loaders templates for ranking and trend profiles 2024-11-22 20:29:27 +01:00
ionutboangiu
21409fc92e Add new CommonListenerService 2024-11-14 17:48:09 +01:00
ionutboangiu
ad104573e9 Remove concurrent_requests diameter opt
Will be replaced by caps.
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
d8acee74e2 Add *fileLineNumber var for file readers 2024-11-03 13:19:45 +01:00
ionutboangiu
c895681980 Improve CoreSv1.Status API with more detailed metrics
- add new metrics (off by default)
- add Debug boolean option for full metric details
- add Timezone option for 'running_since' field
- update default metrics shown and their constants
- remove utils.GetStartTime(), now use process metrics
2024-11-03 13:19:45 +01:00
ionutboangiu
176c91764f SplitPath: stop at '#' for nesting separator 2024-11-03 13:19:45 +01:00
ionutboangiu
0dfe689d8e Add postgres stor_db SSL opts 2024-11-03 13:19:45 +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
a251547408 Use correct consts for stordb types 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
e0c05ecfa7 Add redis pipeline window and limit cfg opts
Set redisPoolPipelineWindow to control duration before pipeline
flush (0 disables implicit pipelining) and redisPoolPipelineLimit
for max commands per pipeline (0 means no limit, only time window
applies).
2024-10-29 18:54:51 +01:00