Commit Graph

12961 Commits

Author SHA1 Message Date
arberkatellari
0cfc4b5658 Continue caching_delay implementation & tests 2024-01-08 11:00:10 -05:00
arberkatellari
87bb4b1665 Add caching_delay flag to cgr-loader 2023-12-22 10:20:31 -05:00
gezimbll
422d9196b4 Added new filter "*contains" 2023-12-18 17:30:15 +01:00
ionutboangiu
b4ef61d6f2 Update eventcost FieldAsInterface methods
Rating map is now accessible from Accounting.

ExtraCharges struct is accessible from Accounting.

RatingUnit fields that did not represent the id of another event cost struct
are now retrievable.
2023-12-13 20:32:27 +01:00
ionutboangiu
17fbc2d51b Rename mongoScheme opt to mongoConnScheme 2023-12-12 10:10:26 +01:00
ionutboangiu
24cbe49d90 Add support for mongodb+srv conn format
Option can be found in db opts under the name 'mongoSchema'.
2023-12-11 17:15:40 +01:00
ionutboangiu
1154cad0df Rename max_recursion_depth cfg param to fallback_depth 2023-12-07 17:08:22 +01:00
ionutboangiu
ff53446e41 Make recursion_max_depth a configurable option
Also added an integration test checking the recursion depth functionality.
2023-12-07 17:08:22 +01:00
ionutboangiu
7886a35d63 Rename composeURI func to composeMongoURI
To reflect that it's used exclusively for MongoDB (for now at least).

Also added a descriptive comment to the function.
2023-12-07 17:07:42 +01:00
ionutboangiu
a057b34505 Use simple string concatenation to build URI
No need to keep the Parse call as a validation step since
any issue would be caught when establishing a connection.

Renamed buildURL to composeURI.
2023-12-07 17:07:42 +01:00
ionutboangiu
b502920b0b Revise buildURL function
The RawQuery field would not be properly populated in
the old implementation. Has been fixed by calling the
Parse function at the end.
2023-12-07 17:07:42 +01:00
gezimbll
f258a289f4 Updated statmetrics test && added comments 2023-12-01 18:27:44 +01:00
gezimbll
b99d87c262 Added OneEvent functionality for statmetrics && tests 2023-12-01 18:27:44 +01:00
gezimbll
b2aad38e68 Added OneEvent functionality to StatS 2023-12-01 18:27:44 +01:00
gezimbll
5f801c8b67 Revise integration tests 2023-11-30 16:52:43 +01:00
gezimbll
443cb81828 Updated registrarc config to populate connection id from NodeID 2023-11-30 16:52:43 +01:00
ionutboangiu
0c91933065 Revise ERs event exporting
Add ees_success_ids and ees_failed_ids fields in reader config. The
former will be used to set EeIDs when the event processing returns
no error, while the latter will be used otherwise.

Add config sanity checks for the added options.

Remove Processed opts and everything related to them since they should
not be used anymore.

Fixed test compilation errors caused by the change.
2023-11-29 16:21:51 +01:00
ionutboangiu
f4e11d8a5a Add ees_conns field option for ERs section 2023-11-29 16:21:51 +01:00
arberkatellari
20f2f7353e Add tests for SSv1AuthorizeEvent with *sms & *data 2023-11-16 11:17:54 +01:00
arberkatellari
c6c4b17316 Improve default case for DurationFormatConverter 2023-11-16 09:05:45 +01:00
arberkatellari
e32ebe8415 Add duration format data converter 2023-11-15 17:24:44 +01:00
gezimbll
6161d33617 Resolve amqp test compilation error 2023-11-15 10:25:21 +01:00
gezimbll
bf89dd7650 Add default evencost when it's nil for ees
it fixes the panic on scenario  when  we define  a template containing *ec fields and exported cdr doesn't contain
a costdetails field.
2023-11-15 10:25:21 +01:00
ionutboangiu
a440c18c0c Prolong expiration date for balance in unit test 2023-11-14 18:26:54 +01:00
ionutboangiu
22d7ecf784 Add test for multiple groups pricing +testsuite update 2023-11-14 18:26:05 +01:00
ionutboangiu
7eeab045a3 Trim fldPath Increments before retrieving one of its fields 2023-11-14 18:23:33 +01:00
gezimbll
42892eff01 Updated gocs_it_test for debiting account of au_site only by replication 2023-11-13 17:11:30 +01:00
ionutboangiu
df7ab84462 Ensure scheduler thread safety 2023-11-09 19:11:41 +01:00
arberkatellari
953bb6de52 Improve GetAccountCost 2023-11-09 11:19:04 +01:00
arberkatellari
054c584775 Create APIerSV1GetAccountCost 2023-11-09 09:37:34 +01:00
arberkatellari
681cd3c58a Add dryrun for CDRsV2ProcessEvent 2023-11-09 09:37:34 +01:00
arberkatellari
8781b968ac Remove unnecessary LazySanityCheck 2023-11-09 09:37:34 +01:00
arberkatellari
ec8058cd29 Adapt test to new RadiusAgent changes 2023-11-09 09:37:34 +01:00
Varun Dhand
5e513d130d fix: typo in rjreader.go 2023-11-09 09:37:34 +01:00
ionutboangiu
c282d40201 Implement reconnect logic for AMQP EventReader
Implemented functionality that handles reconnecting to the amqp server
and reinitializing the amqp channel in case of errors and timeouts. This
is handled by a goroutine created in the client constructor (it also
handles the initial connect/init).

Reconnects and reinits will use a fibonacci backoff strategy, and the
attempt amount and max waiting interval can be adjusted by the
'reconnects' and 'max_reconnect_interval' config options.

Messages that fail processing are now dropped instead of being requeued,
preventing infinite processing loops. However, this means that the
messages are lost. Handling failed messages will need to be addressed
separately.

'concurrent_requests' will now set the prefetch count. Setting the
prefetch count using the Qos function was able to replace our old
approach that was using channels. Default value is 1024 which,
according to the rabbitmq docs, 'runs into the law of diminishing
returns'. The recommended value is between 100-300. Source:
https://www.rabbitmq.com/confirms.html#channel-qos-prefetch-throughput

Fix test compilation errors and failing tests caused by these changes.

References #4160
2023-11-08 18:31:07 +01:00
ionutboangiu
f696164177 Add reconnects and max_reconnect_interval config options for ers
They are separate for each configured reader.

Additional changes:
 - rearrange config_defaults fields for ers/ees;
 - add comment for RunDelay config option inside struct definition;
 - improve comments for amqp opts in config_defaults.
2023-11-08 18:31:07 +01:00
ionutboangiu
a30e261260 Remove go type limits constants
They can be retrieved directly from the std math package.
Slightly optimize the Fib functions and improve comments.
2023-11-08 18:31:07 +01:00
ionutboangiu
9771377b51 Implement additional retrieval methods for ordered map
Map() is used to return a shallow copy of the underlying map.
GetByIndex() is used to return the key-value pair at the specified index.
2023-11-08 18:31:07 +01:00
ionutboangiu
5a832df0ae Update dependencies 2023-11-08 17:11:40 +01:00
ionutboangiu
9b18816b51 Make sure required analyzers db file exists in test 2023-11-08 17:11:40 +01:00
ionutboangiu
29f58debc9 Clone header before creating exporter HTTP request
Behind http.Header is just a map and it's not safe for concurrent use.
Before this change, a panic might have occurred when doing asynchronous
HTTP exports (applies to both *http_post and *http_json_map exporters).
Cloning the header before adding it to the HTTP request has fixed this
issue.

Slightly improved the test that found this data race.
2023-11-08 17:11:40 +01:00
gezimbll
c7e1f8f036 Remove staticchecks warnings for migrator 2023-11-08 17:10:13 +01:00
gezimbll
09e5088262 Removed warnings from go staticcheck 2023-11-08 17:10:13 +01:00
gezimbll
c2dacc42c1 Removed warnings from go staticcheck 2023-11-08 17:10:13 +01:00
gezimbll
529430bd4d added tests for debiting data units without ratingsubject 2023-11-08 17:04:41 +01:00
gezimbll
9e2a629b82 Add *log flag for logging ees events 2023-11-08 16:52:38 +01:00
Varun Dhand
c4fefedefa fix: typo in rjreader.go 2023-11-02 19:40:53 +01:00
Varun Dhand
0997d308ee Update CONTRIBUTORS.md 2023-11-02 19:40:53 +01:00
Varun Dhand
6baffaa67c fix: typo in rjreader.go 2023-11-02 19:40:53 +01:00
gezimbll
2d137915c1 Avoid potential deadlock in session test 2023-11-02 19:40:03 +01:00