ComposantsComponents

ComposantsComponents › Logs & ErreursLogs & Errors

tFlowMeter

tFlowMeter

Logs & ErreursLogs & Errors

Compte les lignes qui le traversent, sans les modifier, et envoie ce nombre au tFlowMeterCatcher du job à la fin du flux. Il sert à suivre les volumes traités par un job : combien de lignes lues, gardées, écrites.Counts the rows going through it, without changing them, and sends that number to the tFlowMeterCatcher of the job at the end of the flow. It is used to track the volumes processed by a job: how many rows read, kept, written.

EntréeInput

Un lien Main, obligatoire : il ne peut pas commencer un sous-job. Aucun déclencheur en entrée.One Main link, required: it cannot start a subjob. No trigger as input.

SortieOutput

Un lien Main (les mêmes lignes) ou Iterate.One Main link (the same rows) or Iterate.

Déclencheurs en sortieOutput triggers

On Component Ok On Component Error Run ifOn Component Ok On Component Error Run if

UtilisationUsage

Compter les lignes d'un fluxCount the rows of a flow

row1 (Main)row2 (Main)row3 (Main)tFileInputDelimited_1tFlowMeter_1tFileOutputDelimited_1tFlowMeterCatcher_1tLogRow_1

Le tFlowMeter laisse passer les lignes et les compte. À la fin du flux, le tFlowMeterCatcher du job reçoit le compte et le transmet.The tFlowMeter lets the rows through and counts them. At the end of the flow, the tFlowMeterCatcher of the job receives the count and passes it on.

Comparer à un autre lienCompare with another link

row1 (Main)row2 (Main)row3 (Main)tFileInputDelimited_1tFilterRow_1tFlowMeter_1…

En mode Relatif avec row1 pour référence, le message porte les deux nombres : lignes gardées et lignes lues.In Relative mode with row1 as reference, the message carries both numbers: rows kept and rows read.

  1. Insérez le tFlowMeter sur le lien à mesurer.Insert the tFlowMeter on the link to measure.
  2. Donnez-lui un libellé, ou gardez le nom du lien d'entrée.Give it a label, or keep the name of the input link.
  3. Ajoutez au job un tFlowMeterCatcher suivi d'une sortie (console, fichier, table). Sans lui, le tFlowMeter ne fait rien.Add to the job a tFlowMeterCatcher followed by an output (console, file, table). Without it, the tFlowMeter does nothing.

Paramètres simplesBasic settings

Les libellés sont ceux de l'onglet Composant ; le nom technique, en gris, est celui du paramètre dans le fichier du job (fautes d'orthographe d'origine comprises). Le composant n'a pas de paramètres avancés propres.Labels are those of the Component tab; the technical name, in grey, is the parameter name in the job file (original misspellings included). The component has no advanced settings of its own.

ParamètreSettingDéfautDefaultVisibleShownDescription
Utiliser le nom de la connexion d'entrée comme libelléUse input connection name as labelUSEROWLABELOuiYesToujoursAlwaysLe libellé du message est le nom du lien qui entre dans le composant (row1).The label of the message is the name of the link entering the component (row1).
LibelléLabelMETTERLABEL"MyLabel""MyLabel"Case précédente décochéePrevious box untickedLibellé du message, expression Java de type String, évaluée à la fin du flux.Label of the message, Java expression of type String, evaluated at the end of the flow.
ModeModeABSOLUTEAbsoluAbsoluteToujoursAlwaysAbsolu : le message ne porte que le nombre de lignes. Relatif : il porte en plus le nombre de lignes d'un lien de référence. Aucun pourcentage n'est calculé par le job.Absolute: the message only carries the number of rows. Relative: it also carries the number of rows of a reference link. No percentage is computed by the job.
Liste des connexionsConnections ListCONNECTIONS——Mode : RelatifMode: RelativeLe lien de référence, parmi les liens de flux (Main, Merge) du job.The reference link, among the flow links (Main, Merge) of the job.
SeuilsThresholdsTHRESHLODSvideemptyToujoursAlwaysTableau de paliers : Libellé (texte brut, sans guillemets), Palier bas (0), Palier haut (80), Couleur. Ils sont recopiés dans la colonne thresholds du message et ne changent rien au job : c'est à l'outil qui lit les messages de s'en servir.Table of ranges: Label (raw text, without quotes), Low end (0), Top end (80), Color. They are copied to the thresholds column of the message and change nothing in the job: it is up to the tool reading the messages to use them.

Ce que fait le composantWhat the component does

Il ajoute 1 à un compteur pour chaque ligne et ne touche pas aux données. À la fin du flux, il envoie un message à chaque tFlowMeterCatcher du job. Le code généré :It adds 1 to a counter for each row and does not touch the data. At the end of the flow, it sends a message to each tFlowMeterCatcher of the job. The generated code:

tFlowMeterCatcher_1.addMessage("Kept rows",
    new Integer(count_tFlowMeter_1), "row1", "", "tFlowMeter_1");

Dans l'ordre : libellé, nombre de lignes, lien de référence, seuils, nom du composant.In order: label, number of rows, reference link, thresholds, name of the component.

Pas de variable globaleNo global variable

Le composant ne déclare aucune variable globale : le nombre de lignes n'est disponible que dans le message reçu par le tFlowMeterCatcher (colonne count).The component declares no global variable: the number of rows is only available in the message received by the tFlowMeterCatcher (count column).

Pour un compte à lire dans un Run if ou un tJava, utilisez la variable NB_LINE d'un composant du flux (tLogRow, composants de fichier…).For a count to read in a Run if or a tJava, use the NB_LINE variable of a component of the flow (tLogRow, file components…).

ExemplesExamples

Sorties copiées telles quelles depuis une exécution des jobs (Java 21, Windows). Les durées, les dates et les identifiants d'exécution changent à chaque lancement : vous n'obtiendrez pas les mêmes valeurs.Outputs copied as is from a run of the jobs (Java 21, Windows). Durations, dates and run identifiers change at every run: you will not get the same values.

Réglages par défautDefault settings

row1 (Main)row2 (Main)row3 (Main)tFixedFlowInput_1tFlowMeter_1tLogRow_1tFlowMeterCatcher_1tLogRow_2

Cinq lignes ; tLogRow_1 en tableau, tLogRow_2 en mode vertical.Five rows; tLogRow_1 as a table, tLogRow_2 in vertical mode.

.--+------.
|tLogRow_1|
|=-+-----=|
|id|city  |
|=-+-----=|
|1 |Paris |
|2 |Lyon  |
|3 |Lille |
|4 |Nantes|
|5 |Brest |
'--+------'

.----------------------------------------------.
|                #1. tLogRow_2                 |
+-------------------+--------------------------+
| key               | value                    |
+-------------------+--------------------------+
| moment            | 2026-11-18 14:31:31      |
| pid               | D8zml7                   |
| father_pid        | D8zml7                   |
| root_pid          | D8zml7                   |
| system_pid        | 14156                    |
| project           | DEMO                     |
| job               | JOB_DocLC_Meter_A_defaut |
| job_repository_id | _PNRgfNd8G64ddu7PhAGwEB  |
| job_version       | 0.1                      |
| context           | Default                  |
| origin            | tFlowMeter_1             |
| label             | row1                     |
| count             | 5                        |
| reference         | null                     |
| thresholds        |                          |
+-------------------+--------------------------+

Le libellé est le nom du lien d'entrée, row1 ; reference est null en mode Absolu. Les colonnes sont décrites sur la page du tFlowMeterCatcher.The label is the name of the input link, row1; reference is null in Absolute mode. The columns are described on the tFlowMeterCatcher page.

Mode Relatif après un filtreRelative mode after a filter

row1 (Main)row2 (Main)row3 (Main)row4 (Main)tFixedFlowInput_1tFilterRow_1tFlowMeter_1tLogRow_1tFlowMeterCatcher_1tLogRow_2

Le filtre garde id <= 2. tFlowMeter : Libellé "Kept rows", Mode Relatif, Liste des connexions : row1.The filter keeps id <= 2. tFlowMeter: Label "Kept rows", Mode Relative, Connections List: row1.

.--+-----.
|tLogRow_1|
|=-+----=|
|id|city |
|=-+----=|
|1 |Paris|
|2 |Lyon |
'--+-----'

.-----------------------------------------------.
|                 #1. tLogRow_2                 |
+-------------------+---------------------------+
| key               | value                     |
+-------------------+---------------------------+
| moment            | 2026-11-18 14:31:46       |
| pid               | Y3A1mi                    |
| father_pid        | Y3A1mi                    |
| root_pid          | Y3A1mi                    |
| system_pid        | 63492                     |
| project           | DEMO                      |
| job               | JOB_DocLC_Meter_F_relatif |
| job_repository_id | _BQsQH8tzq-gwVjXuyX_0cC   |
| job_version       | 0.1                       |
| context           | Default                   |
| origin            | tFlowMeter_1              |
| label             | Kept rows                 |
| count             | 2                         |
| reference         | 5                         |
| thresholds        |                           |
+-------------------+---------------------------+

2 lignes comptées, 5 sur le lien de référence. Le même job en mode Absolu donne count 2 et reference null.2 rows counted, 5 on the reference link. The same job in Absolute mode gives count 2 and reference null.

SeuilsThresholds

Job du premier exemple ; Libellé : "Cities loaded" ; deux seuils : low, 0, 3, rouge (255;0;0) et normal, 3, 80, vert (0;255;0).Job of the first example; Label: "Cities loaded"; two thresholds: low, 0, 3, red (255;0;0) and normal, 3, 80, green (0;255;0).

.---------------------------------------------------------.
|                      #1. tLogRow_2                      |
+-------------------+-------------------------------------+
| key               | value                               |
+-------------------+-------------------------------------+
| moment            | 2026-11-18 14:33:04                 |
| pid               | xL5rjt                              |
| father_pid        | xL5rjt                              |
| root_pid          | xL5rjt                              |
| system_pid        | 75788                               |
| project           | DEMO                                |
| job               | JOB_DocLC_Meter_P_seuils            |
| job_repository_id | _aYZ8Dxnxy-80iBW14FhEKC             |
| job_version       | 0.1                                 |
| context           | Default                             |
| origin            | tFlowMeter_1                        |
| label             | Cities loaded                       |
| count             | 5                                   |
| reference         | null                                |
| thresholds        | low|0|3|255|0|0#normal|3|80|0|255|0 |
+-------------------+-------------------------------------+

Chaque seuil devient libellé|bas|haut|rouge|vert|bleu ; les seuils sont séparés par #. Le compte (5) n'est comparé à rien.Each threshold becomes label|low|top|red|green|blue; thresholds are separated by #. The count (5) is compared with nothing.

Flux videEmpty flow

row1 (Main)row2 (Main)row3 (Main)tFixedFlowInput_1tFilterRow_1tFlowMeter_1tLogRow_1

Le filtre ne garde rien (id > 10) ; réglages par défaut.The filter keeps nothing (id > 10); default settings.

.---------------------------------------------.
|                #1. tLogRow_2                |
+-------------------+-------------------------+
| key               | value                   |
+-------------------+-------------------------+
| moment            | 2026-11-18 14:31:43     |
| pid               | Chs0L4                  |
| father_pid        | Chs0L4                  |
| root_pid          | Chs0L4                  |
| system_pid        | 47224                   |
| project           | DEMO                    |
| job               | JOB_DocLC_Meter_E_vide  |
| job_repository_id | _V0o_sR4aGLoQtgP_s-1lcA |
| job_version       | 0.1                     |
| context           | Default                 |
| origin            | tFlowMeter_1            |
| label             | row2                    |
| count             | 0                       |
| reference         | null                    |
| thresholds        |                         |
+-------------------+-------------------------+

Le message part quand même, avec un compte de 0.The message is still sent, with a count of 0.

Deux tFlowMeter dans un fluxTwo tFlowMeter in a flow

row1 (Main)row2 (Main)row3 (Main)row4 (Main)row5 (Main)tFixedFlowInput_1tFlowMeter_1tFilterRow_1tFlowMeter_2tLogRow_1tFlowMeterCatcher_1tLogRow_2

tFlowMeter_1 : libellé "Read". tFlowMeter_2 : libellé "Kept", mode Relatif, référence row1. tLogRow_2 en tableau.tFlowMeter_1: label "Read". tFlowMeter_2: label "Kept", Relative mode, reference row1. tLogRow_2 as a table.

.-------------------+------+----------+--------+----------+-------+----------------------+-----------------------+-----------+-------+------------+-----+-----+---------+----------.
|                                                                                    tLogRow_2                                                                                     |
|=------------------+------+----------+--------+----------+-------+----------------------+-----------------------+-----------+-------+------------+-----+-----+---------+---------=|
|moment             |pid   |father_pid|root_pid|system_pid|project|job                   |job_repository_id      |job_version|context|origin      |label|count|reference|thresholds|
|=------------------+------+----------+--------+----------+-------+----------------------+-----------------------+-----------+-------+------------+-----+-----+---------+---------=|
|2026-11-18 14:32:01|WRdcvF|WRdcvF    |WRdcvF  |38948     |DEMO   |JOB_DocLC_Meter_I_deux|_86jvrDN6MuxFtzqZZoW5aB|0.1        |Default|tFlowMeter_1|Read |5    |null     |          |
|2026-11-18 14:32:01|WRdcvF|WRdcvF    |WRdcvF  |38948     |DEMO   |JOB_DocLC_Meter_I_deux|_86jvrDN6MuxFtzqZZoW5aB|0.1        |Default|tFlowMeter_2|Kept |2    |5        |          |
'-------------------+------+----------+--------+----------+-------+----------------------+-----------------------+-----------+-------+------------+-----+-----+---------+----------'

Un message par tFlowMeter, dans l'ordre du flux ; la colonne origin dit lequel a compté.One message per tFlowMeter, in the order of the flow; the origin column says which one counted.

PiègesPitfalls

Guillemets dans le libellé d'un seuilQuotes in the label of a threshold

Seuils "low" et "normal" écrits avec des guillemets. Message de compilation abrégé :Thresholds "low" and "normal" written with quotes. Shortened compilation message:

JOB_DocLC_Meter_B_libelle.java:1571: error: ')' or ',' expected
	tFlowMeterCatcher_1.addMessage("Cities loaded", new Integer(count_tFlowMeter_1), "null", ""low"|0|3|255|0|0#"normal"|3|80|0|255|0", "tFlowMeter_1");
	                                                                                           ^
…

Les seuils sont recopiés à l'intérieur d'un texte Java. Le libellé d'un seuil s'écrit sans guillemets (low), au contraire du Libellé du composant, qui est une expression Java.Thresholds are copied inside a Java string. The label of a threshold is written without quotes (low), unlike the Label of the component, which is a Java expression.

Erreur dans le flux : aucun messageError in the flow: no message

row1 (Main)row2 (Main)row3 (Main)tFixedFlowInput_1tFlowMeter_1tJavaRow_1tLogRow_1

Le tJavaRow lève une exception à la quatrième ligne ; un tFlowMeterCatcher suivi d'un tLogRow est dans le job (trace abrégée) :The tJavaRow throws an exception at the fourth row; a tFlowMeterCatcher followed by a tLogRow is in the job (shortened trace):

1|Paris
2|Lyon
3|Lille
Exception in component tJavaRow_1 (JOB_DocLC_Meter_L_erreur)
java.lang.RuntimeException: Row 4 refused
	at demo.job_doclc_meter_l_erreur_0_1.JOB_DocLC_Meter_L_erreur.tFixedFlowInput_1Process(JOB_DocLC_Meter_L_erreur.java:1670)
	…

Le message n'est envoyé qu'à la fin normale du flux. Ici trois lignes sont passées, mais le tFlowMeterCatcher n'affiche rien : le compte est perdu avec l'erreur.The message is only sent at the normal end of the flow. Here three rows went through, but the tFlowMeterCatcher displays nothing: the count is lost with the error.

Sans tFlowMeterCatcher, rienWithout a tFlowMeterCatcher, nothing

Le job du premier exemple sans tFlowMeterCatcher n'affiche que le tableau du tLogRow_1 : aucun message n'est produit et rien ne signale l'oubli.The job of the first example without a tFlowMeterCatcher only displays the table of tLogRow_1: no message is produced and nothing reports the omission.

Relatif sans lien choisiRelative with no link chosen

Mode Relatif avec une Liste des connexions vide : reference vaut null, comme en mode Absolu, sans avertissement (vérifié par l'exécution).Relative mode with an empty Connections List: reference is null, as in Absolute mode, with no warning (checked by a run).

Une référence utileA useful reference

La référence n'a d'intérêt que sur un lien situé avant un composant qui retire ou ajoute des lignes. Avec le lien d'entrée ou de sortie du tFlowMeter lui-même, reference est égal à count (2 et 2 dans le job filtré).The reference is only of interest on a link located before a component that removes or adds rows. With the input or output link of the tFlowMeter itself, reference equals count (2 and 2 in the filtered job).

Un compte en fin de fluxA count at the end of the flow

Le message n'existe qu'une fois le flux terminé : pas de compte intermédiaire pendant un long traitement, et un seul message par exécution du sous-job.The message only exists once the flow is over: no intermediate count during a long processing, and a single message per run of the subjob.

ConseilsTips

Un libellé parlantA meaningful label

row7 ne dit rien dans une table de suivi, et change si le lien est recréé. Décochez la première case et écrivez un libellé stable ; c'est une expression : "Cities of " + jobName donne Cities of JOB_DocLC_Meter_M_libelle_expression dans le job de ce nom.row7 says nothing in a tracking table, and changes if the link is recreated. Untick the first box and write a stable label; it is an expression: "Cities of " + jobName gives Cities of JOB_DocLC_Meter_M_libelle_expression in the job of that name.

Garder les comptesKeep the counts

Reliez le tFlowMeterCatcher à un fichier ou à une table plutôt qu'à la console : chaque exécution y ajoute ses lignes, avec la date, le job et le contexte.Connect the tFlowMeterCatcher to a file or a table rather than to the console: each run adds its rows there, with the date, the job and the context.

Voir aussiSee also