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
2024-11-01 15:59:39 +01:00
2024-10-23 21:11:25 +02:00
2024-11-01 15:59:39 +01:00
2024-11-01 15:59:39 +01:00
2024-11-01 15:59:39 +01:00
2024-11-01 15:59:39 +01:00
2024-08-21 20:59:10 +02:00
2024-10-29 18:54:51 +01:00
2024-10-23 21:11:25 +02:00
2024-11-01 15:59:39 +01:00
2024-10-23 21:11:25 +02:00
2023-05-31 10:22:28 +02:00
2024-02-27 16:27:07 +01:00
2024-11-01 15:59:39 +01:00
2024-11-01 15:59:39 +01:00
2023-09-26 21:30:25 +02:00
2020-06-24 16:28:50 +03:00
2021-11-02 10:29:22 +02:00
2022-03-18 11:59:39 +01:00
2019-06-12 22:11:43 +02:00
2014-10-14 12:12:51 +02:00
2024-09-25 20:58:51 +02:00
2024-09-25 20:58:51 +02:00
2012-02-25 14:27:06 +02:00
2024-09-23 20:28:26 +02:00
2023-09-26 21:30:25 +02:00
2019-09-04 16:22:08 +02:00

Real-time Online/Offline Charging System (OCS) for Telecom & ISP environments

Build Status Documentation Status GoDoc

Features

  • Real-time Online/Offline Charging System (OCS).
  • Account Balances Management with bundle support.
  • Session or Event charging with reservation.
  • Rating engine.
  • CDR logging with support for Interim Records.
  • QoS LCR and LCR over Bundles.
  • Fraud detection with automatic mitigation.
  • Call Statistics with pattern monitoring.
  • Performance oriented.
  • Modular architecture.
  • Test driven development.
  • Plug-able/non-intrusive into existing setups.
  • Cloud-ready, built on independent micro-services with rich set of RPC APIs.
  • Agile in developing new features.
  • Very fast (5000+ req/sec on a single machine)
  • Good documentation.
  • Commercial support available

Documentation

Step by steps tutorials

Debian apt-get repository

Installing CGRateS from sources on minimal debian (for devel or testing)

Browsable HTML docs http://readthedocs.org/docs/cgrates/

PDF, Epub, Manpage http://readthedocs.org/projects/cgrates/downloads/

API reference godoc

Also check irc.freenode.net #cgrates (Webchat) and Google group for a more real-time support.

Description
No description provided
Readme 111 MiB
Languages
Go 99%
Shell 0.7%
Jinja 0.1%
Python 0.1%