DlfStore(3pm)
π DlfStore(3pm) π
Okay bestie, welcome to the LogReport's Lire Documentation page for DlfStore(3pm) β manual name folded in near the top like a little bow. π
β¨ NAME β¨
Lire::DlfStore β Interface to a DLF store, but make it fashion. π
π¦ SYNOPSIS π¦
use Lire::DlfStore;
my $store = Lire::DlfStore->open( "mystore", 1 );
my $avail_streams = $store->dlf_streams;
π DESCRIPTION π
Okay so this is the main-character module for poking at a DLF store. It gives you a Lire::DlfStore instance, and from there you can get at content, streams, reports, etc. Let's go method by method, bestie.
open( $store_path, [ $create ] );
Opens a Lire::DlfStore living in the directory pointed at by $store_path, and returns a Lire::DlfStore instance you can use to access its content. β¨
If the store$store_pathwasn't created, this method will die unless$createwas set to true. If the store is locked by another process, it will also die. Trying to open the same store twice from the same process will fail. Not me giving you three warnings... okay yes me. π
close()
Call this to release the lock your current process is holding on the store. If you don't call it, it gets called automatically when the store reference goes out of scope β but you better not rely on that to close your stores. Periodt.
is_closed()
Returns true if this DlfStore was closed and cannot be used anymore. It's giving ghosted. π
path
Returns the path to the store. This is the argument used to create the store. Simple, iconic. π
config
Returns the configuration of the store, instantiated as a Lire::Config::ConfigFile. Yes bestie, config file realness. π
import_jobs()
Returns, as an array ref, the list of ImportJob currently configured in the DlfStore. π₯
report_jobs()
Returns, as an array ref, the list of ReportJob currently configured in the DlfStore. π
has_report_config( $name )
Returns true if there is a report configuration named $name in this DlfStore. β
report_configurations()
Returns, as an array ref, the list of ReporConfig currently configured in the DlfStore. (Yes, ReporConfig β we keep the spelling exactly as the original. π)
get_report_config( $name )
Returns the Lire::ReportConfig object named $name. Throws an exception if it doesn't exist. No object, no vibes. π
π DLF STREAMS RELATED METHOD π
A DlfStore can contain multiple Dlf Streams. A Dlf Stream is data conforming to a DLF schema. The streams are represented by Lire::DlfStream objects. π¦
dlf_streams()
Lists the DLF streams available in the DLF store. This returns a list of DlfSchema's name. π
has_dlf_stream( $name )
Returns true if the DlfStore contains a DlfStream conforming to the schema $name. π
get_stream_config( $name )
Returns the Lire::Config::Dictionary instance which contains the stream configuration for the $name DlfStream. This method will create an instance from the default if necessary. If $name isn't a valid schema name, this method will throw an error. β οΈ
configured_dlf_streams()
Returns the list of DlfStreams which are referenced by the store configuration. This is the result of dlf_streams() plus all schemas that exist and are used by one of the configured ImportJob or DlfStreamSpec. π§
open_dlf_stream( $name, [$mode], [$sort_spec] )
Returns a Lire::DlfStream object that can be used with a DLF stream in the schema $name. The $mode parameter can either be "r" or "w" and defaults to "r". π
- If the mode is
"w", theLire::DlfStreamis opened for writing (new Dlf records can be inserted). If theDlfStoredidn't contain a stream$name, an empty one will be created. βοΈ - If the mode is
"r", theLire::DlfStreamis opened for reading (no DLF records may be inserted). An exception will be thrown if there is no stream$nameavailable. π«
When the stream is opened in "r" mode, a sort order can be specified by passing a $sort_spec. A $sort_spec is a white-space delimited list of field names which should specify the sort order. Reverse sort order can be specified by prefixing the field's name by -. π
run_analysers( $stream, [ $dlf_source ] )
Runs all the configured analysers on the DLF stream $stream. $dlf_source limits the records which should be analysed. π§
clean_streams()
Removes records that are days older than what is configured in the 'keep_days' parameter. π§Ή
π REPORTS RELATED METHOD π
A DlfStore also contains the periodically generated reports. These reports are usually configured through the lire(1) command. The generated reports are stored in Lire XML native format by period. π
put_report( $job, $schedule, $report )
Saves the $report Lire::Report which was generated by $job and $schedule. Returns the filename where the report was saved. πΎ
find_report_source( $job, $schedule, [$time] )
Returns a hash reference containing parameters on how the ReportJob $job should be generated for the ReportSchedule $schedule. The boundaries of the period are determined according to $time, which defaults to now. π°οΈ
The hash reference will contain a 'source' key as well as possible others:
sourceβ Says from what kind of source the report should be generated. Possible values are'dlf'when the report should be generated from DLF,'merging'when the report should be generated by merging previous XML reports, and'none'when no data is available for that period and the report cannot be generated. Note that'merging'is only available as a source for schedules above'daily'β i.e.'hourly'and'daily'reports can only be generated from DLF. Also important: only'daily'reports are available as a source of merging, so you need a daily report schedule to generate'weekly','monthly', and'yearly'schedules by merging. πstartβ The timestamp at which the available data for the period starts. This can be higher than the requested period's starting boundary. β³endβ The timestamp at which the available data for the period ends. This can be lower than the requested period's ending boundary. βcoverageβ An integer between 0 and 100 representing the ratio of data available for the requested period. For example, if only 6 hours of data are available for a'daily'report, the'coverage'will be 25. πreportsβ This key is only available when'source'is'merging'. It contains an array of report files which should be used as the source of merging. πdaysβ This key is only available when'source'is'merging'. It contains the days for which a report was available for merging. For example, if only 6 daily reports were available to generate a'weekly'report, this will contain those 6 days dates in ISO format (%Y-%m-%d). ποΈ
π₯ SEE ALSO π₯
Lire::DlfConverter(3pm)β go look, bestie. Iykyk. π
π AUTHOR π
Francis J. Lacoste <flacoste@logreport.org> β icon behavior. π
β VERSION β
$Id: DlfStore.pm,v 1.41 2011/11/15 16:48:40 wraay Exp $
π COPYRIGHT π
Okay legal bestie moment, here's the exact copyright and license text, no games:
Copyright (C) 2002,2004 Stichting LogReport Foundation LogReport@LogReport.org
This file is part of Lire.
Lire is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program (see COPYING); if not, check with http://www.gnu.org/copyleft/gpl.html.
π That's the page! Source/version vibes: Lire 2.1.1, dated 2025-09-28. Go forth and store your DLFs, bestie. πβ¨
π¦ where this page comes from
- arch rolling: lire 2.1.1-8 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms