mirror of
https://github.com/cgrates/cgrates.git
synced 2026-02-11 18:16:24 +05:00
Add FilePath metric in EventExporter
This commit is contained in:
committed by
Dan Christian Bogos
parent
7694a4ef42
commit
00ecfbee13
@@ -55,8 +55,12 @@ type FileCSVee struct {
|
||||
// init will create all the necessary dependencies, including opening the file
|
||||
func (fCsv *FileCSVee) init() (err error) {
|
||||
// create the file
|
||||
if fCsv.file, err = os.Create(path.Join(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].ExportPath,
|
||||
fCsv.id+utils.Underline+utils.UUIDSha1Prefix()+utils.CSVSuffix)); err != nil {
|
||||
filePath := path.Join(fCsv.cgrCfg.EEsCfg().Exporters[fCsv.cfgIdx].ExportPath,
|
||||
fCsv.id+utils.Underline+utils.UUIDSha1Prefix()+utils.CSVSuffix)
|
||||
fCsv.Lock()
|
||||
fCsv.dc[utils.FilePath] = filePath
|
||||
fCsv.Unlock()
|
||||
if fCsv.file, err = os.Create(filePath); err != nil {
|
||||
return
|
||||
}
|
||||
fCsv.csvWriter = csv.NewWriter(fCsv.file)
|
||||
|
||||
@@ -51,9 +51,13 @@ type FileFWVee struct {
|
||||
|
||||
// init will create all the necessary dependencies, including opening the file
|
||||
func (fFwv *FileFWVee) init() (err error) {
|
||||
filePath := path.Join(fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].ExportPath,
|
||||
fFwv.id+utils.Underline+utils.UUIDSha1Prefix()+utils.FWVSuffix)
|
||||
fFwv.Lock()
|
||||
fFwv.dc[utils.FilePath] = filePath
|
||||
fFwv.Unlock()
|
||||
// create the file
|
||||
if fFwv.file, err = os.Create(path.Join(fFwv.cgrCfg.EEsCfg().Exporters[fFwv.cfgIdx].ExportPath,
|
||||
fFwv.id+utils.Underline+utils.UUIDSha1Prefix()+utils.FWVSuffix)); err != nil {
|
||||
if fFwv.file, err = os.Create(filePath); err != nil {
|
||||
return
|
||||
}
|
||||
return fFwv.composeHeader()
|
||||
|
||||
@@ -2335,6 +2335,7 @@ const (
|
||||
TotalSMSUsage = "TotalSMSUsage"
|
||||
TotalMMSUsage = "TotalMMSUsage"
|
||||
TotalGenericUsage = "TotalGenericUsage"
|
||||
FilePath = "FilePath"
|
||||
)
|
||||
|
||||
// Event Opts
|
||||
|
||||
Reference in New Issue
Block a user