Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Spots 10.0 Report Processing Language

332 views

Published on

Spots 10.0 Report Processing Language

Published in: Education
  • Be the first to comment

  • Be the first to like this

Spots 10.0 Report Processing Language

  1. 1. SIEMENS S.A. SPOTS V10 Drop 4 Report Processing Language April/2003 E200301-01-314-V10.0I-01
  2. 2.  SIEMENS S.A. OG IC, R&D WON NM CP2 R. Irmãos Siemens, nº 1 2720-093 Amadora Portugal All rights reserved. No part of this document may be reproduced or transmitted in any form or by any means, electronic or mechanical, including photocopying and recording, for any purpose other than the purchaser’s personal use without the written permission of Siemens S.A. This document consists of a total of 56 pages. The information contained in this document is subject to change.
  3. 3. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. Table of Contents 1 Preface........................................................................................................................................ 3 2 Getting Started............................................................................................................................ 4 2.1 What is the SPOTS Reporting Language?........................................................................................4 2.2 Why Using SRL? ...............................................................................................................................4 3 Learning the Basics .................................................................................................................... 5 3.1 SRL Concepts ...................................................................................................................................5 3.2 SRL Structure ....................................................................................................................................8 3.2.1 Input Variables..........................................................................................................................9 3.2.2 Request Section........................................................................................................................9 3.2.2.1 Objects ...........................................................................................................................10 3.2.2.2 Counters.........................................................................................................................11 3.2.2.3 Time ...............................................................................................................................11 3.2.2.4 Granularity......................................................................................................................12 3.2.2.5 Data Type.......................................................................................................................12 3.2.3 Result Section.........................................................................................................................12 3.2.4 Processing Section (Method & Report Sections)....................................................................13 3.2.4.1 Types..............................................................................................................................13 3.2.4.2 Variables’ Definition .......................................................................................................15 3.2.4.3 Parameters and Arguments ...........................................................................................15 3.2.4.4 Sentences ......................................................................................................................16 3.2.4.5 Scopes ...........................................................................................................................16 3.3 Pre-defined Methods .......................................................................................................................17 3.3.1 Associated with Rows.............................................................................................................17 3.3.2 Associated with Columns........................................................................................................18 3.3.3 Associated with Sheets...........................................................................................................19 3.3.4 Associated with Cubes............................................................................................................20 3.3.5 Associated with Result Cubes ................................................................................................21 3.3.6 Associated with Result Columns.............................................................................................21 3.3.7 Library traffic_lib......................................................................................................................22 3.3.8 Library math_lib ......................................................................................................................22 3.3.9 Library misc_lib.......................................................................................................................23 3.3.10 Library time_lib......................................................................................................................23 3.3.11 Library string_lib....................................................................................................................24 3.4 Developing Reports with SRL..........................................................................................................26 3.4.1 Report Sample........................................................................................................................26 3.4.1.1 Request Section.............................................................................................................27 3.4.1.2 Result Section ................................................................................................................27 3.4.1.3 Method Section ..............................................................................................................27 3.4.1.4 Report Section ...............................................................................................................28 3.5 Creating a Report ............................................................................................................................29 4 Language Reference ................................................................................................................ 31 4.1 SRL Syntax......................................................................................................................................31 4.1.1 Lexical Specification ...............................................................................................................31 4.2 Reserved Words..............................................................................................................................33 5 Annexes .................................................................................................................................... 34 5.1 Grammar .........................................................................................................................................34 5.2 Report Samples...............................................................................................................................41 5.2.1 Time Evolution Report ............................................................................................................41 5.2.2 Daily Totals Report .................................................................................................................43 5.2.3 SPBH Daily Peak Report ........................................................................................................44 5.2.4 SPBH Max Peak Report..........................................................................................................46 5.2.5 Top n Report ...........................................................................................................................48 5.2.6 Day Periods Time Evolution Report........................................................................................51 6 References................................................................................................................................ 53 7 Glossary & Abbreviations.......................................................................................................... 54 i E200301-01-314-V10.0I-01
  4. 4. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) List of Figures Figure 1 – Data Cube (counters, objects and time) ....................................................................... 5 Figure 2 – Different data element Relationship. ............................................................................ 6 Figure 3 – Requests to database and processing results.............................................................. 6 Figure 4 – Graphical representation of a request. ....................................................................... 10 Figure 5 – Process of creation of a new report............................................................................ 29 List of Tables Table 1 – SRL supported types ................................................................................................... 13 Table 2 – Operations between SRL supported types .................................................................. 15 Table 3 – SRL Reserved words ................................................................................................... 33 ii E200301-01-314-V10.0I-01
  5. 5. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 1 Preface The manual is subdivided in three parts: Getting Started provides a brief introduction to SPOTS Reporting Language (SRL). Learning the Basics explains the concepts behind SRL and provides an overview of the structure of an SRL program. Language Reference presents the syntax, a detailed specification of lexical information and the SRL predefined libraries. In addition to the parts above, annexes are included, providing the SRL Grammar and examples of reports. 3 E200301-01-314-V10.0I-01
  6. 6. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 2 Getting Started 2.1 What is the SPOTS Reporting Language? Any programming language serves two related proposes: it provides a vehicle for the progra-mmer to specify actions to be executed, and it provides a set of concepts for the programmer to use when thinking about what can be done. The SRL is used within the SPOTS product to produce performance and traffic statistics. It allows defining the input raw data, already stored on the SPOTS database, and the processing algorithms necessary to produce the required statistical indicators. Currently SRL is only concerned with algorithms and statistical data values and not on how this data is to be presented to the user. 2.2 Why Using SRL? The SRL provides great flexibility to adapt existing reports and create new ones, tailored to your specific needs. 4 E200301-01-314-V10.0I-01
  7. 7. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 3 Learning the Basics 3.1 SRL Concepts The raw data obtained from the database is represented as a data Cube, like a group of spread-sheets: time samples row counter columns data cell objects’ sheets Figure 1 – Data Cube (counters, objects and time) The dimensions of this raw data Cube are always the same: • Measurement counters (as X axis), ordered as specified by the user. • Time (as Y axis), where the begin of the time period are the values closer to upper side of the Cube. • Objects (as Z axis), ordered as specified by the user. This raw data Cube contains the following elements: • Cell: the basic element of the Cube, with an associated value: a time stamp, a counter and an object. • Sheet: set of data Cells related to some counters of a particular object in a time period. • Row: each row of the object Sheet means a time sample of one or more counters. • Column: each column of the object Sheet means a counter in a time period. 5 E200301-01-314-V10.0I-01
  8. 8. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) The next figure describes the relationship between the different data elements. Cube Sheet Row Sample Column Figure 2 – Different data element Relationship. Cell Each subset of data “inherits” information about objects, counters and time of the superset, i.e. a Sheet can be created from a Cube, but a Column can be either created from a Cube or a Sheet. However, the Cube can be only created by a database request. Each request to the database creates a different Cube. The data is processed and generates an output with information about the associated object/counter/time, grouped in other Cubes, Sheets or Columns. The next figure illustrates the main idea: REPORT PROCESSING Request 1 (…) Request n Result Column Figure 3 – Requests to database and processing results Result Sheet Result Cube An incoming data Cube is made of raw data retrieved from the database, and it is read-only (the data cannot be modified). It is a group of Sheets (objects) with the same size (counters x time). Each Cube is always associated with only one Object Class. The raw data Cube is completely filled with values; if there are no values, it is filled with NO_DATA values. 6 E200301-01-314-V10.0I-01
  9. 9. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. Result data can either be a Result Cube, a Result Sheet or a Result Column, and is based on processed or raw data. It can be seen also as a book of Sheets, but these Sheets can have different dimensions: • Single value, with one data stamp. • Many values, many counters in a period of time. Anyway the concept of time, counters and objects is maintained. This language is oriented to manage these Cube elements: the Cube itself, Sheets, Columns, Rows or Cells) and to process them to obtain new elements. That is the processing kernel, where we can use the language to create new algorithms of processing over these data Cubes. 7 E200301-01-314-V10.0I-01
  10. 10. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 3.2 SRL Structure The programs defined by the language can be divided in four different sections, which must be always in this order: 1. Input Variables, passed as part of the input parameters of a report call. 2. Request Section, specifies the query to the DB in order to create the data Cube. 3. Result Section, specifies the results. 4. Method Section, specifies the methods used by the report. 5. Report Section, specifies the “main” method of the report, the method to be executed when the report is invoked. With the exception of Method Section, all the others are mandatory. This is a basic example of report program that makes a request of a Trunk Group’s incoming and outgoing calls and returns, as output, the addition of both variables (Calls Carried): request tgrp_request { classname = “TGRPOC”; objects = $OBJECTS; counters = “TGRP:CC_IC;TGRP:CC_OO”; periodbegin = $PERIOD_BEGIN; periodend = $PERIOD_END; granularity = HOUR_QUARTERLY; datatype = DETAILED; } //Result expected result tgrp_result { } method CallsCarried (column cc_ic, column cc_oo) return column { return cc_ic + cc_oo; } report r1() { int i; column c_aux; for ( i = 0; i < tgrp_request.getNumberOfObjects(); i=i+1 ) { c_aux=CallsCarried (tgrp_request.getColumn(“TGRP:CC_IC”,i), tgrp_request.getColumn(“TGRP:CC_OO”,i)); tgrp_result.addColumn(“CallsCarr”, tgrp_request.getObjectReference(i), “Nr”, c_aux.getResultColumn()); } } 8 E200301-01-314-V10.0I-01
  11. 11. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 3.2.1 Input Variables Report input variables can be defined as $VARIABLES, which are defined at run-time. They represent the variables of the report that will be substituted in execution time (objects, counters, time or other parameters). They always begin with a dollar symbol (“$”) and can be followed by any alphanumeric characters, underscores or dollar symbols. For example, $PARAMETER_1 Note: For the usage of the SRL reserved $VARIABLES, refer to Section 3.5. 3.2.2 Request Section The user must specify the parameters of the query to the DB to create a data Cube. This means three fixed axes of the Cube: Counters (X axis), Time (Y axis) and Objects (Z axis). The request is defined according to the following syntax: request IDENTIFIER { ...classname = STRING; //or $VARIABLE objects = STRING; //or $VARIABLE counters = STRING; //or $VARIABLE ...periodbegin = CONST_TIME; //STRING or $VARIABLE ...periodend = CONST_TIME; //STRING or $VARIABLE ...granularity = CONST_GRANULARITY; ...datatype = CONST_DATATYPE; } Example of a request specification: request IDENTIFIER { ...// Z axis ...classname = “TGRPOC”; ...objects = “/South/Lisbon@NEO18:BF5021;/South/Lisbon@NEO18:BF5022”; ...// X axis ...counters = “TGRP:CC_IC;TGRP:CC_OO”; ...// Y axis ...periodbegin = 19801012000001; ...periodend = 1980101400000; ...granularity = HOUR_QUARTERLY; ...// type of data datatype = DETAILED; } A graphical representation of this example could be: 9 E200301-01-314-V10.0I-01
  12. 12. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) Sheet 0 Sheet 1 TGRPOC:/@NEO18:BF5021 TGRP:CC_IC TGRP:CC_OO 19801012001500 2500.0 1992.0 19801012003000 2400.0 1003.0 19801012004500 300.0 251.0 19801012010000 2499.0 2452.0 (…) (…) (…) 19801013010000 2221.0 2003.0 (…) (…) (…) 19801014000000 2231.0 2211.0 TGRPOC:/@NEO18:BF5022 TGRP:CC_IC TGRP:CC_OO 19801012001500 500.0 499.0 19801012003000 1112.0 1020.0 19801012004500 2300.0 2202.0 19801012010000 1220.0 1203.0 (…) (…) (…) 19801013010000 2231.0 2222.0 (…) (…) (…) 19801014000000 2122.0 2121.0 Column 0 Column 1 Column 0 Column 1 Figure 4 – Graphical representation of a request. The user can define as many requests as he needs, referencing them in the code by the identi-fier after the reserved word request. The request can be also defined dynamically, i.e. the user can use input variables that will be substituted in execution time. In the following example, the object(s), the counter(s) and the time period will be specified when the report is invoked: request IDENTIFIER { ...objects = $OBJECTS; ...counters = $COUNTERS_LIST; ...periodbegin = $PERIOD_BEGIN; ...periodend = $PERIOD_END; ...granularity = HOUR_QUARTERLY; datatype = DETAILED; } 3.2.2.1 Objects The STRING assigned to the request’s objects keyword contains the Object Instance Identifier. Each Object Instance belongs to one certain Object Class in the SPOTS Object Model. Each Object Class has a set of attributes that characterise that class. Inside SRL, the Identifier of each individual Object Instance is a string concatenation of the object’s attribute values separated by “:” (colon). For example, the Trunk Group object class “TGRPOC” has 3 key attributes: <Domain ID>@<Network Node name>:<Trunk Group name> One example of the Identifier STRING of one object instance of this class would be: “/South/Lisbon@NEO18:BF5021” In the same STRING assigned to the request’s objects keyword, it can defined as many Object Instances as wanted, separating them by “;” (semicolon). For example: “/South/Lisbon@NEO18:BF5021;/South/Lisbon@NEO18:BF5022” 10 E200301-01-314-V10.0I-01
  13. 13. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. The SRL grammar allows the user to specify wildcards: “*” and “?”. “*” represents all combinations of alphanumeric characters, while “?” represents any alphanu-meric character (but only one). Example of a STRING assigned to the request’s objects keyword using wildcards: “/South/Lisbon@NEO18:*” (all TGRP objects that are related with the node “NEO18”) If the user needs to aggregate the results of a request with wildcards, the symbol “+” can be used. For example, “/South/Lisbon@+NEO18:*” would match the same objects as the previous example but, instead of showing the data for all objects, it will show the same data aggregated (for the virtual object associated with all TGRPs of the node “NEO18”). In addition, Sets of Objects (SOO) can be used. SOOs are created within the SCL environment, under the PM Entities task group — for more information about this subject, refer to Section 4.3.3 – Sets of Objects in [01]. SOOs can be referred using the keyword SOA, to aggregate the data, or SOD, to get a result per each SOO component. Examples: objects = “SOD!MySetOfObjects” objects = “SOA!MySetOfObjects” Note: For the usage of the SRL reserved variable $OBJECTS, refer to Section 3.5. 3.2.2.2 Counters The STRING assigned to the request’s counters keyword must have the following structure: “<Measurement name>:<Counter name>” In the same STRING, it can be defined as many Counters as wanted, separating them by “;” (semicolon). For example: “TGRP:CC_IC;TGRP:CC_OO” Sets of Counters (SOC) can also be used. As SOOs, SOCs are created within the SCL environ-ment, under the PM Entities task group — for more information about this subject, refer to Section 4.3.2 – Sets of Counters in [01]. Set of Counters are referred using the keyword SOC, as described in the following example: counters = “SOC!MySetOfCounters” Additionally, Virtual Counters (VC) can be assigned to the request’s counters keyword. VCs are created within the SCL environment, under the PM Entities task group — for more information about this subject pls. refer to Section 4.3.1– Virtual Counters in [01]. Virtual Counters are referred using the keyword VC. Example: counters = “VC!VirtualCounter” 3.2.2.3 Time The time period is defined by its begin/end values (STRING), following the format specified in Section 4.1.1. Note: For the usage of the SRL reserved variables $PERIOD_BEGIN and $PERIOD_END, refer to Section 3.5. 11 E200301-01-314-V10.0I-01
  14. 14. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 3.2.2.4 Granularity Counters’ values can be presented according to one of the following granularities (Reserved Words): DAILY FIVE_MINUTES HOURLY HOUR_QUARTERLY MONTHLY ONE_MINUTE WEEKLY Note: For detailed data (see Section 3.2.2.5), any of these values can be requested, independently of how data is stored in the SPOTS database. Therefore, aggregation or sub-division of the stored PM data values will be performed, if the specified report granularity is different from the “original” value (in the SPOTS database). 3.2.2.5 Data Type SPOTS reporting is applied to detailed and historical data — for the description of these data ty-pes, refer to [01], Section 1.6 – Internal data organisation. In the report’s Request Section, the following values (Reserved Words) can be used: DETAILED HISTORICAL_SPBH HISTORICAL_TOTALS Note: For historical data, report results are presented with the following granularities, independently of the specified value (see Section 3.2.2.4): HOURLY granularity for HISTORICAL_SPBH; DAILY granularity for HISTORICAL_TOTALS 3.2.3 Result Section This section is intended to provide a way for controlling the results to be presented, (post) processing the data produced by the report/methods of the Processing Section. For example, sorting the data or restricting the results via filtering criteria (sub-set of objects, sub-periods of the time interval…). However, for the current SRL version, this functionality isn't yet available, i.e. this section inclu-des only the result name, to be invoked in the Processing Section to receive the computed results. Therefore, the syntax for the definition of the result is restricted to: result IDENTIFIER {} Example of a result specification: result my_result { } 12 E200301-01-314-V10.0I-01
  15. 15. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 3.2.4 Processing Section (Method & Report Sections) The user must define the methods first and then the reports that will use these methods: Method Definition: method IDENTIFIER ( Parameters ) return Type MethodBody Report Definition: report IDENTIFIER ( Parameters ) ReportBody MethodBody or a ReportBody are composed by the sentences that define the processing code of the programs. Both bodies create a new scope between the open and close brackets, where the local variables are defined before the rest of the sentences. They have the same syntax (similar to the “C language” syntax). The only difference is that a method can return a value and allows the return sentence in its code. 3.2.4.1 Types The types supported by the language and the allowed operations between types are described in the next table: Type Description bool Boolean type (true or false). int 32 bits value with sign. double 64 bits value with sign. string String type (a constant string is delimited by quotation marks). cell It is the minimum reference to a Sheet structure. It can be associated to a concrete object, time instant and counter. For the current SRL version, cell’s type is restricted to double. row It is a set of Cells in the same instant of time and refer to the same object and to all the counters defined to that object. column It is a set of Cells referred to the same counter of the same object and in a time period. sheet It is a set of Cells referred to the same object, in a time period and referred to a set of counters. cube It is not implemented as a variable definable type, but it is used implicitly when accessing the raw data Cube. result_column It is a set of Cells of the same counter and object. A time stamp is associated with each Cell (this is the difference to a Column). result_cube It is not implemented as a variable definable type, but it is used implicitly when accessing a result. time Type to support time related variables. Table 1 – SRL supported types The operations can be grouped in three different types: arithmetical, conditional and logical. 13 E200301-01-314-V10.0I-01
  16. 16. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) Arithmetical Operations The arithmetical operators are: + (plus) - (minus) — it can be used as unary or binary operator. * (multiply) / (divide) If the arithmetical operation is between different types, the result type is the most global type. For example: int + double = double or double + column = column. If the arithmetical operation is between an integer or a double and a Cube Element (cell, row, column, sheet or result_column) it takes effect to all the data that is grouped by that Cube ele-ment. For example, 1.0 + var_column, adds 1.0 to every position/value of the var_column. If the arithmetical operation is between two Cube Elements, these elements must have the sa-me dimension and takes effect between the values in the same position. For example: var_row1 + var_row2 is only valid if both Rows belong to the same object class and have the same counter associated to them. Another example: var_column1 * var_column2 is only valid if both Rows belong to the same object class and have the same time period associated to them. The result could be represented graphically in this way: 1.0 5.4 6.4 3.2 + 6.2 = 9.4 3.1 0.3 3.4 Note: A Cube element (cell, column, row or sheet) must be always initialised, before beging used. This means that every element must be assigned to another element of the same type or an element read from the Cube, with the pre-defined methods. Conditional Operations The conditional operators are: == (equal) != (not equal) > (greater) < (less) >= (greater or equal) <= (less or equal) The result of a conditional operation is a boolean value (true or false). Logical Operations Finally, the logical operators are: ! (not) — it is a unary operator. && (and) || (or) The operands and the result are boolean values (true or false). 14 E200301-01-314-V10.0I-01
  17. 17. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. The allowed operations between types are described in the next table: bool int double cell row column sheet result_ column bool Logical int Arithm. (all) Condit. (all) Arithm. (all) Condit. (all) Arithm. (all) Condit. (all) Arithm. (all) Arithm. (all) Arithm. (all) Arithm. (all) double Arithm. (all) Condit. (all) Arithm. (all) Condit. (all) Arithm. (all) Condit. (all) Arithm. (all) Arithm. (all) Arithm. (all) Arithm. (all) cell Arithm. (all) Condit. (all) Arithm. (all) Condit. (all) Arithm. (all) Condit. (all) row Arithm. (all) Arithm. (all) Arithm. (all) ==,!= column Arithm. (all) Arithm. (all) Arithm. (all) ==,!= sheet Arithm. (all) Arithm. (all) Arithm. (all) ==,!= result_ Arithm. (all) Arithm. (all) Arithm. (all) column ==,!= Table 2 – Operations between SRL supported types 3.2.4.2 Variables’ Definition As stated before, each time a method or a report is declared, a new scope is open where we can define new local variables (this definition must be done before any other sentences). The syntax to define variables is Type ListOfIdentifiers; where ListOfIdentifiers is one identifier or more, separated by commas. For example: int j, var_1; column column_var1, column_var2; 3.2.4.3 Parameters and Arguments The method definition gives the possibility to specify parameters as input. These parameters are passed by value but not by reference, so this means that the method can only return a value or operate directly over external structures that are defined in a global scope (refer to Section 3.2.4.5). If the list of parameters is not empty, it is defined according to the following syntax: Type IDENTIFIER [, Type DENTIFIER] These are some examples: method m1(int a, int b) {} // two parameters, type int method m2(int a) {} // one parameter, type int method m3() return int { return 1; } // no parameter When the method is invoked, the parameters’ type is checked. For example: report r1() { int a; m1(1, a); // ok m2(“Test”); // error a = m3(); // ok } 15 E200301-01-314-V10.0I-01
  18. 18. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 3.2.4.4 Sentences The language allows the following types of sentences: • Empty Sentence: it is a semicolon (“;”) and it is used as a separator between sentences. • Body Sentence: used to group a set of sentences (for example, when we are defining a loop covering more than one sentence). It has the following syntax: { Sentences } • Assign Sentence: the language allows the assignment of values that are the result of any expression. It has the following syntax: Variable = Expression ; • Method Call Sentence: this is the way to invoke methods. User-defined methods are invoked according to the following syntax: METHOD_NAME ( Argument List ); METHOD_NAME ( ); The syntax for invoking pre-defined methods is described in Section 3.3. • Conditional Sentence: it has the following syntax: if ( Conditional Expression ) then Sentence or if ( Conditional Expression ) then Sentence else Sentence where Conditional Expression controls the sentence to be applied: − if true, the Sentence after then; − if false, the Sentence after else. • Repetitive Sentences: there are two ways to define a loop: using a for sentence or a while sentence. The following syntax is applied: for ( For_initialitations ; Conditional Expression ; For_increment ) Sentence and while ( Conditional Expression ) Sentence where: For_initialitations is the initial value of the “iteration control”. Conditional Expression is the “boolean control”: the Sentence is executed only if the expression is true. For_increment is the increment of the “iteration control”, perfor-med after each iteration (loop). • Return Sentence: it is used only in the methods’ scope and identifies the return to the caller (method or report) and, eventually, the value to deliver. It has the following syntax: return Expresion ; or return ; 3.2.4.5 Scopes The language defines two different scopes: • Global Scope: it takes effect in the whole program. Request, method, result and report names are included in this scope. They can be referred anywhere. • Local Scope: it takes effect in the report’s or method’s body. All processing variables and method parameters are included. They are not visible out of this scope — therefore, local variables of different scopes may have the same name. 16 E200301-01-314-V10.0I-01
  19. 19. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 3.3 Pre-defined Methods There are two kinds of pre-defined methods: • Associated with a basic type. The following Types are applied: row, columns, sheets, cube, result_column and result_cube — the operatations that are allowed between the existing types are described in Table 2. • Library methods. The following libraries are available: traffic_lib (Traffic methods). math_lib (Mathematical methods). time_lib (Date and time methods). string_lib (String methods). misc_lib (Miscellaneous methods). Methods are invoked according to the following syntax: VariableName.MethodName (ArgumentList); // Type associated methods or LibraryName.MethodName (ArgumentList); // Library methods Examples: Invoke the “row associated” method clear to initialize the values of the row “Last_Counters” with “0”: Last_Counters = Last_Counters.clear; Invoke the library method abs to compute the absolute value of the variable “Difference” and keep it in the variable”Unsigned_Difference”: Unsigned_Difference = math_lib.abs (Difference); The list of methods (grouped, in alphabetic order, by associated type or library) are described below. Note: The Cell’s value (shortly referred in the methods’ description as “value”) is the value of the corresponding counter. The value’s type is double (refer to Section 3.2.4.1). 3.3.1 Associated with Rows clear () Clears (sets to “0”) the values of the Row. row clone () Returns a copy of the Row. double maximum () Returns the maximum of the values of the Row. int nelem () Returns the number of elements of the Row. double sum () Returns the sum of the values of the Row. 17 E200301-01-314-V10.0I-01
  20. 20. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 3.3.2 Associated with Columns addValue (double value, int y_coord) Adds a value in the specified Column’s position (Cell). column aggregate (long granularity) Aggregates the Column according to the specified granularity (refer to Section 3.2.2.4). The size of the aggregated Column depends on the applied granularity. For the aggregation concept, refer to [01], Section 1.6 – Internal data organisation. double avg () Returns the average of the values of the Column. clear () Clears (sets to “0”) the values of the Column. column clone () Returns a copy of the Column. result_column getDailyTotals (string process_type) Returns the “daily total” value(s) in the referred Column, computed according to the speci-fied process (“sum”, “avg”, “max” or “min”). This process depends on the counter’s unit — for the daily total concept (Historical data), refer to [01], Section 1.6 – Internal data orga-nisation). string getDate (int y_coord) Returns the date associated with the specified Column’s position (Cell). The date’s format is described in Section 4.1.1). int getGranularity () Returns the granularity of the Column (refer to Section 3.2.2.4). result_column getRelatedValues (result_column ref_col) Based on the time period associated with the specified ref_col, a Result Column is returned with the values of the referred Column and the corresponding dates of that time period. result_column getResultColumn () Converts the Column in a Result Column (type conversion). double getValue (int y_coord) Returns the value associated with the specified Column’s position (Cell). double getValueByDate (string date) Returns the (counter’s) value associated with the specified date, in the referred Column. double max () Returns the maximum of the values of the Column. result_column max_pbh (string process_type Returns the maximum of the SPBH value(s) and its asociated date (PBH), in the referred Column — refer to the “pbh” method, described below. 18 E200301-01-314-V10.0I-01
  21. 21. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. result_column maxTimeValue () Returns the maximum of the values of the Column and its associated date. int nelem () Returns the number of elements of the Column. result_column pbh (string process_type) Returns the (daily) PBH and SPBH values in the referred Column (one pair “PBH/SPBH” per each day within the time period associated with the Column), computed according to the specified process (“sum”, “avg”, “max” or “min”). This process depends on the counter’s unit — for the PBH concept (Historical data), refer to [01], Section 1.6 – Inter-nal data organisation. setGranularity (int granularity) Sets the granularity of the Column (refer to Section 3.2.2.4). double sum () Returns the sum of the values of the Column. result_column tcbh (string process_type) Returns the TCBH values (PBH and SPBH of the “average day”) in the referred Column, computed according to the specified process (“sum”, “avg”, “max” or “min”). This process depends on the counter’s unit — for the PBH concept (Historical data), refer to [01], Section 1.6 – Internal data organisation. 3.3.3 Associated with Sheets clear () Clears (sets to “0”) the values of the Sheet. sheet clone () Returns a copy of the Sheet. int getGranularity () Returns the granularity of the Sheet. int getNumberOfColumns () Returns the number of Columns of the Sheet. int getNumberOfRows () Returns the number of Rows of the Sheet. int nelem () Returns the number of elements of the Sheet. 19 E200301-01-314-V10.0I-01
  22. 22. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 3.3.4 Associated with Cubes bool empty () Returns true if the Cube is empty (the Cells have no values). column getColumn (string counter_name, int z_coord) Returns, for the object located at z_coord, the Column identified by counter_name. int getGranularity () Returns the granularity of the Cube. int getNumberOfObjects () Returns the number of objects of the Cube. string getChildrenAggregatedObjects (int z_coord) Returns the “virtual object” that is composed by the "children" of the object located at z_coord. The Object containment tree (the hierarchical structure of object classes) is described in [01], Section 5.3 – Object classes and identifiers. For the description of the “virtual object” concept, refer to [01], Section 4.3.3 – Sets of Objects. string getChildrenObjects (int z_coord) Returns the "children" of the object located at z_coord. For the description of the Object containment tree (the hierarchical structure of object classes), refer to [01], Section 5.3 – Object classes and identifiers. string getObjectClass () Returns the name of the object class associated with the Cube. string getObjectName (int z_coord) Returns the name of the Sheet associated with the object located at z_coord. ObjectReference getObjectReference (int z_coord) Returns the reference (“pointer”) to the object located at z_coord. string getParentName (int z_coord) Returns the name of the "parent" of the object located at z_coord. For the description of the Object containment tree (the hierarchical structure of object classes), refer to [01], Section 5.3 – Object classes and identifiers. row getRow (int y_coord, int z_coord) Returns a Row of the Cube, i.e. all the counters related with the object located at z_coord and with the time stamp identified by y_coord. sheet getSheet (int z_coord) Returns a Sheet of the Cube, i.e. all the Columns that are associated with the object loca-ted at z_coord. 20 E200301-01-314-V10.0I-01
  23. 23. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. load () Forces the Cube to be loaded. Note that the Cube is (implicitly) loaded whenever any method of this Section (“unload” excluded) is invoked. unload () Frees memory of a (loaded) Cube (the Cube becomes empty). 3.3.5 Associated with Result Cubes addColumn ( string column_name, ObjectReference object_reference, string unit_name, result_column rc) Adds the Result Column rc to the Cube. The string column_name is the name of the column as it will be shown in the output. For the possible values of unit_name, refer to [01], Section 5.8 – Counter Units. setValue (int x_coord, int y_coord, int z_coord, double value) Sets the input parameter value with the counter’s value that is associated with the Cell located in the position (x_coord, y_coord, z_coord). 3.3.6 Associated with Result Columns addDateValue (string date, double value) Adds a new pair “date / (counter) value” to the Result Column. The date’s format is described in Section 4.1.1. clear () All the Result Column’s components (pairs “date/value”) are removed (the Result Column becomes empty). double getValueByDate (string date) Returns the (counter) value associated with the specified date. The date’s format is described in Section 4.1.1. double getValueByPosition (int position) Returns the value associated with the Result Column’s component, identified by its posi-tion (index) in the Result Column. result_column max () Returns the maximum value and the associated date in the Result Column. string maxTimeValue () Returns the date of the maximum value in the Result Column. double setValueByPosition (int position, double value) Sets the value associated with the Result Column’s component, identified by its position (index) in the Result Column. 21 E200301-01-314-V10.0I-01
  24. 24. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 3.3.7 Library traffic_lib double calcTrunks (double TrafOff, double AdmisibleLoss) Returns the number of resources (e.g. Trunks in a TGRP) that would be required to achieve a blocking probability (loss) lower than the specified AdmisibleLoss (in “%”). It is computed via the “Erlang B” formula. string getVersion (objectReference object, string date) Returns the network node’s SW version associated with the specified object at the referred date — for details on the network node’s SW version, refer to [01], Section 4.1.2 – Configuring Software Versions. double Loss (double TrafCarr, double Resources) Returns the blocking probability (loss) to handle the specified traffic (in “erlangs”), using the available Resources. It is computed via the “Erlang B” formula. 3.3.8 Library math_lib double abs (double val) Returns the absolute value. double cosine (double val) Returns the cosine value. The parameter’s value is expressed in radians. double logarithm (double val) Returns the “natural” logarithm. double power (double base, double exponent) Returns base raised to the power of exponent. double round (double val) Returns the rounded value (e.g. 6.3 → 6.0; 6.7 → 7.0). double sine (double val) Returns the sine value. The parameter’s value is expressed in radians. double squareRoot (double val) Returns the square root value. 22 E200301-01-314-V10.0I-01
  25. 25. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 3.3.9 Library misc_lib defineVariable ( string Variable_Name, Type Value, // the type depends on the parameter TypeOfValue string TypeOfValue) The $VARIABLE named Variable_Name (defined at run-time) is set with the specified Value. One of the following types can be used: bool, int, double, string or time. error (string err_msg) The report’s execution is terminated, returning the error message err_msg to the appli-cation under which the report is being executed. sendAlarm ( string MeasVersion, ObjectReference object, string date, string ErrorSeverity, string TriggeredThreshold, double Value, string AdditionalInfo) The specified threshold-crossing alarm is sent to the SAS where the report is being exe-cuted. sendMail ( string ToAddress, string Subject, string Body) The e-mail (Subject and Body) is sent to the specified addressee(s). 3.3.10 Library time_lib time aDayBefore (time date_var) Returns the time for the day before the date date_var. time aMonthBefore (time date_var) Returns the time for one month before the date date_var. time aWeekBefore (time date_var) Returns the time for one week before the date date_var. int day (time date_var) Returns the day (1..31) of the date date_var. time firstMonthsDay (time date_var) Returns the time for the first day of the month associated with the date date_var. time firstWeeksDay (time date_var) Returns the time for the first day of the week associated with the date date_var. time firstYearsDay (time date_var) Returns the time for the first day of the year associated with the date date_var. int hour (time date_var) Returns the hour (0..23) of the date date_var. 23 E200301-01-314-V10.0I-01
  26. 26. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) time lastMonthsDay (time date_var) Returns the time for the last day of the month associated with the date date_var. time lastWeeksDay (time date_var) Returns the time for the last day of the week associated with the date date_var. time lastYearsDay (time date_var) Returns the time for the last day of the year associated with the date date_var. int minute (time date_var) Returns the minute (0..59) of the date date_var. int month (time date_var) Returns the month (1..12) of the date date_var. time readTimeFromString (string date_var, string format) A date is converted from “string” to “time”. The format of the string (second method’s parameter) is composed by six words: “YYYY” (year), “MM” (month) “DD” (day), “HH” (hour), “mm” (minute) and “SS” (second). The sequence and the separator (one character) are not fixed. time today () Returns the current date. int year (time date_var) Returns the year of the date date_var. int weekDay (time date_var) Returns the weekday of the date date_var, using the following convension: 1 for Mon-day, 2 for Tuesday… and 7 for Sunday. 3.3.11 Library string_lib string append (string str1, string str2) Appends two strings. bool compare (string str1, string str2) Compares two strings (returns true if they are equal). The second string can use wildcards (“*” and “?”). For example: “anystart” and “*start” are equal; “middle” and “mi??le” are equal. string find (string str1, string str2) Returns the sub-string of str1 that starts with str2 characters. string left (string str1, int n) Returns the n first characters of str1. long length (string str1) Returns the length (number of characters) of a string. string lowercase (string str1) Returns str1 in lowercase. 24 E200301-01-314-V10.0I-01
  27. 27. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. string replace ( string str1, string str2, string str3) Returns a string where all occurrences of str2 are replaced by str3. string right (string str1, int n) Returns the n last characters of str1. string subString ( string str1, int start_pos, int len) Returns a sub-string of str1. string trim (string str1) Removes spaces from a string. string uppercase (string str1) Returns str1 in uppercase. 25 E200301-01-314-V10.0I-01
  28. 28. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 3.4 Developing Reports with SRL In SRL the way to define and use methods is very similar to the “C language”. A concrete example will be used to “walk-through” the steps for defining a report. 3.4.1 Report Sample This is an example of how to implement a PBH method, and how to generate a TGRP LOAD report: // Parameters Specification of the query to // the DB to create a data cube. request request_tgrp // Name of the requestused as { // reference to access to raw data. classname = "TGRPOC"; // The Classname objects = "/@NE018.B0501;/@NE018.B0502"; // Only two objects for root domain counters = "TGRP:CC_IC;TGRP:CC_OO"; // Two counters. periodbegin = 19981012000001; // Date of beginning and periodend = 19981013000000; // ending of the period request // as a standard input from the Spots // browser. granularity = HOUR_QUARTERLY; // In seconds = 15 minutes. datatype = DETAILED; // Type of raw data. } // Result expected, this section defines the output result of the report. result tgrp_result { } // Method definition to calculate the Tgrp Load (returned a value). method TGRP_LOAD(column cc_ic, column cc_oo) return column { return cc_ic + cc_oo; } // Method definition to calculate the PBH of a day with granularity 15 minutes. method PBH(column c_input) return result_column { result_column c_output; double pbh_value, aux_value; int i, k, pbh_position; if( c_input.nelem() == 0) return c_output; // By now, we allow the 15' granularity if( c_input.getGranularity() != HOUR_QUARTERLY) return c_output; k=0; pbh_value = 0.0; for (i=0; i < (c_input.nelem() - 3); i=i+1) { aux_value = 0.0; k=k+1; // This and the three next positions aux_value = c_input[i]+ c_input[i+1]+ c_input[i+2]+ c_input[i+3]; if (pbh_value < aux_value) { pbh_value = aux_value; pbh_position = i+3; } if ((k+3)==96) // ONE DAY { c_output.addDateValue(c_input.getDate(pbh_position), pbh_value); pbh_value = 0.0; k=0; i=i+3; } } 26 E200301-01-314-V10.0I-01
  29. 29. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. return c_output; } // Report definition, where the methods are invoked. report r1() { int i; column c_load; result_column c_pbh; // For every object (in this case, only two) for (i=0; i < request_tgrp.getNumberOfObjects(); i=i+1) { // Calculates the load. c_load=TGRP_LOAD(request_tgrp.getColumn("TGRP:CC_IC",i), request_tgrp.getColumn("TGRP:CC_OO",i)); // Calculates the PBH of the load. c_pbh=PBH(c_load); // Adds a new column with the tgrp load values. tgrp_result.addColumn("TGRP_LOAD", request_tgrp.getObjectReference(i), "Nr", c_load.getResultColumn); // Adds a new column with the pbh load value. tgrp_result.addColumn("PBH_TGRP_LOAD", "Nr", request_tgrp.getObjectReference(i), c_pbh); } } 3.4.1.1 Request Section This example has only a request (a data Cube) and its name is request_tgrp. This name will be used as reference when we want to access the raw data. Only two objects are specified in the request (@NE018.B0501 and @NE018.B0502), two TGRPs; two counters (TGRP:CC_IC and TGRP:CC_OO), the incoming and outgoing traffic; and the period of time of one day (1998/10/12), with a granularity of a quarter of hour. 3.4.1.2 Result Section This example has also only a result and its name is tgrp_result. This name will be used as reference when we want to add values to the output result. 3.4.1.3 Method Section Two methods are defined in this example: • TGRP_LOAD: calculates the load of the trunk group. • PBH: Calculates the Peak Busy Hour of a day with a granularity of a quarter of hour. The TGRP_LOAD method has two Columns of the data Cube as arguments, that must be the trunk group’s incoming and outgoing counters, and just add them, returning a Column with the addition of the values of the input Columns. The PBH method has a Column as input argument that contains one day (period of time) of data with a quarter hour of granularity. It will return a Result Column with a value (the addition of the values in the PBH) and the time stamp of the last quarter of hour that belongs to the PBH. After the local variable definitions, the code of the PBH method checks if there is data, and then if the granularity is correct. The next step is a loop that begins in the first element of the input Column and ends three elements before the last element of that Column (one hour before). The code in the loop calculates the total value of the hour for each element of the Column (remember that the Column is a sequence of values with dates associated in order of time). It compares if it is greater than the value existing until the moment and, if it is so, stores that value and that position in the Column. It checks if the element is the last of the day, and, if it is so, it adds that pair date-value in the Result Column. At the end, the method returns the Result Column with the corresponding values. 27 E200301-01-314-V10.0I-01
  30. 30. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 3.4.1.4 Report Section In this section only one report (r1) is defined, which calculates the TGRP’s load and the pbh of this TGRP, using the methods described before. The report loops into all the objects of the request (only two in this case), processes each one’s data and stores the result. The result data is stored in tgrp_result using two pre-defined methods: setColumn, which must refer to an already defined Column of the result, and addColumn, which allows to create (and add) dynamically a new Result Column. 28 E200301-01-314-V10.0I-01
  31. 31. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 3.5 Creating a Report The reports can be created using the Reports Editor (refer to [01], Section 4.6). The following steps should be accomplished successfully to create a report: 1. Creation of the report’s SRL source code; 2. Compilation; 3. Publish the report (in the SAS that was selected when SCL session was started) and defi-ne its properties. This comprises the definition of the following: • Location and name in the reports tree presented by the SCL; • Default layout for the report (table or graphic); • Visibility of the report (Public or Private); • Object class to be used; • Run-time variables, specifying its type (int, double, string, bool or time) and the default value; WorkFlow Create Source Report and save it with <name>.sc Compile Source Report Verify possible error messages and warnings and continue if everything is OK. Otherwise repair errors and repeat compilation. Publish the report in the server Remarks Create a report source file named testreport.sc in the user's local platform. Compile the report selecting the option Compile in the Reports menu Publish the report, selecting the option Add Report to Server in the Reports menu. Figure 5 – Process of creation of a new report. 29 E200301-01-314-V10.0I-01
  32. 32. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) Remarks about the usage of external run-time variables ($VARIABLES): 1. There are three reserved $VARIABLES: • $OBJECTS: list of objects to be used in the report. When running the report from the SCL, a list of objects to select will be shown. • $PERIOD_BEGIN: beginning date of the time period. When running the report from the SCL, a calendar will be shown to enable the selection of this date. • $PERIOD_END: ending date of the time period. When running the report from the SCL, a calendar will be shown to enable selection of this date. When the SPOTS user selects a report using the SCL GUI, the $OBJECTS variable needs to be specified from the SPOTS browser (refer to [01], Section 4.5.5 – Class Browser). If the objects for the report are hard-coded in the report’s source, i.e. the report does not use the variable $OBJECTS, the user’s object selection (via the SPOTS browser) will be discar-ded. 2. For non reserved external run-time variables, the SCL GUI will provide a window to input values for each $VARIABLE that is defined in the reports. 30 E200301-01-314-V10.0I-01
  33. 33. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 4 Language Reference 4.1 SRL Syntax SRL syntax is very similar to the “C language”. 4.1.1 Lexical Specification The language allows the following tokens: Identifiers They represent the name of the variables. They must begin by a letter or an underscore (“_”) and could be followed by alphanumeric characters, underscores or dollar symbols (“$”). The maximum size is 256 characters. Normal and capital letters are distinguished, i.e. the “case sensitive” rule is applied. Example: var_1 Report Variables (or $VARIABLES) They represent the variables of the report that will be substituted in execution (objects, counters or time). They always begin with a dollar symbol (“$”) and can be followed by alphanumeric characters, underscores or dollar symbols. Example: $TIME_BEGIN Integer Constants Example: 12 Double Constants Example: 12.0 Time Constants They are defined as integer constants, according the following format: “YYYYMMDDHHMMSS”. Example for the 20th June 2002 at a quarter past 10 (10:15:00): 20020620101500. Strings They are sequences of characters between quotation marks("). Example: “This is a string” Arithmetical Operators The arithmetical operators are: + (plus) - (minus) — it can be used as unary or binary operator. * (multiply) / (divide) If the arithmetical operator is applied between different types (e.g. integer and double) the result’s type is the most global type (e.g. double). 31 E200301-01-314-V10.0I-01
  34. 34. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) Conditional Operators The conditional operators are: == (equal) != (not equal) > (greater) < (less) >= (greater or equal) <= (less or equal) The result of a conditional operation is a boolean value (true or false). Boolean Operations The boolean operators are: ! (not) — it is a unary operator. && (and) || (or) The operands and the result are boolean values. Brackets They are used for different purposes: { or } (brackets) Used as scope’s delimiter. [ or ] (square brackets) Used for indexing the components (Cells) of Columns and Result_columns. ( or ) (parenthesis) Used in expressions and, in the invocation of methods and reports, as delimiter of the parameters’ list. , (comma) Used as separator (e.g. in the methods’ list of parameters). ; (semicolon) Used as separator (e.g. between sentences, in the body of methods or reports). Comments There are two different ways to comment the SRL code: • using “/*” as begin of comment text and “*/” as end of that comment text; • using “//” as begin of a line comment, that will affect the text bounded between the two back slashes and the end of the current line. 32 E200301-01-314-V10.0I-01
  35. 35. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 4.2 Reserved Words bool long (1) break (1) math_lib case (1) method cast (1) misc_lib cell MONTHLY char (1) NO_DATA_VALUE classname new (1) column null (1) columns objects const (1) ONE_MINUTE continue (1) periodbegin counters periodend DAILY report default (1) request datatype result date (1) result_column define (1) return DETAILED row do (1) sheet double sheet_name else show false string FIVE_MINUTES string_lib for switch (1) goto (1) this (1) granularity time HISTORICAL_SPBH time_lib HISTORICAL_TOTALS traffic_lib HOURLY true HOUR_QUARTERLY var (1) if void (1) import (1) WEEKLY int while Table 3 – SRL Reserved words (1) Internally used, i.e. not accessible to the SRL user. 33 E200301-01-314-V10.0I-01
  36. 36. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 5 Annexes 5.1 Grammar SRL uses a context-free grammar, based on an LR1 parser (one token look-ahead LR parser). The following syntax is applied: CompilationUnit : Imports Code ; Code : Requests Results Methods Reports | MethodsDefinitions | /* empty => No code */ ; /************** Imports **************/ Imports : import Location ';' Imports | /* empty */ ; /************** Requests **************/ Requests : Request MoreRequests ; MoreRequests : Request MoreRequests | /* empty */ ; Request : request IDENTIFIER '{' RequestBody '}' ; RequestBody : ClassRequest ObjectRequest CounterRequest PeriodDescription DataTypeRequest ; ClassRequest : classname EQUAL STRING ';' | classname EQUAL VarIdsList ';' ; ObjectRequest : objects EQUAL STRING ';' | objects EQUAL VarIdsList ';' ; CounterRequest : counters EQUAL STRING ';' | counters EQUAL VarIdsList ';' ; VarIdsList : VAR_IDENTIFIER | VarIdsList ',' VAR_IDENTIFIER ; PeriodDescription : PeriodBegin PeriodEnd Granularity ; 34 E200301-01-314-V10.0I-01
  37. 37. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. PeriodBegin : periodbegin EQUAL CONST_INT ';' | periodbegin EQUAL TIME '(' STRING ')' ';' | periodbegin EQUAL VAR_IDENTIFIER ';' ; PeriodEnd : periodend EQUAL CONST_INT ';' | periodend EQUAL time '(' STRING ')' ';' | periodend EQUAL VAR_IDENTIFIER ';' ; Granularity : granularity EQUAL GranularityType ';' ; DataTypeRequest : DATATYPE EQUAL DETAILED ';' | DATATYPE EQUAL HISTORICAL_SPBH ';' | DATATYPE EQUAL HISTORICAL_TOTALS ';' ; /************** Results **************/ Results : Result MoreResults ; MoreResults : Result MoreResults | /* empty */ ; Result : result IDENTIFIER '{' ResultBody '}' ; ResultBody : SheetDescription MoreSheets | RawDataLoad MoreSheets | /* empty */ ; MoreSheets : SheetDescription MoreSheets | RawDataLoad MoreSheets | /* empty */ ; SheetDescription : sheet '{' SheetBody '}' ; SheetBody : SheetTitle ObjectClassName columns PeriodDescription ; ResultSheetBody : SheetTitle ObjectClassName PeriodDescription ; SheetTitle : sheet_name EQUAL STRING ';' ; ObjectClassName : classname EQUAL STRING ';' ; Columns : columns EQUAL STRING ';' | columns EQUAL ListOfNameType ';' ; ListOfNameType : '[' STRING ',' STRING ']' | ListOfNameType ',' '[' STRING ',' STRING ']' ; 35 E200301-01-314-V10.0I-01
  38. 38. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) RawDataLoad : show '{' RequestName BodyLoad '}' ; RequestName : request EQUAL IDENTIFIER ';' ; BodyLoad : ObjectRequest Counters Period | CounterRequest Period | PeriodDescription | /* empty */ ; Counters : CounterRequest | /* empty */ ; Period : PeriodDescription | /* empty */ ; /************** Methods **************/ MethodsDefinitions : Method Methods ; Methods : Method Methods | /* Empty => no method! */ ; Method : method IDENTIFIER MethodParameters ReturnType MethodBody ; MethodParameters : '(' ParameterList ')' | '(' ')' ; MethodBody : Body ; ReturnType : return TypeSpecifier | /* empty : no return */ ; /************** Report **************/ Reports : Report MoreReports ; MoreReports : Report MoreReports | /* empty */ ; Report : report IDENTIFIER ReportParameters ReportBody ; ReportParameters : '(' ParameterList ')' | '(' ')' ; ReportBody : Body ; 36 E200301-01-314-V10.0I-01
  39. 39. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. /************** ParameterList **************/ ParameterList : Parameter | ParameterList ',' Parameter ; Parameter : TypeSpecifier IDENTIFIER | TypeSpecifier AND IDENTIFIER ; /************** TypeSpecifier **************/ TypeSpecifier : PrimitiveType ; PrimitiveType : bool | int | double | sheet | column | row | cell | result_column ; /************** Body **************/ Body : '{' LocalVariables Statements '}' ; /************** Variables **************/ LocalVariables : VariablesStatement LocalVariables | /* empty */ ; VariablesStatement : TypeSpecifier VariableDeclarators ';' ; VariableDeclarators : VariableDeclarator | VariableDeclarators ',' VariableDeclarator ; VariableDeclarator : IDENTIFIER ; 37 E200301-01-314-V10.0I-01
  40. 40. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) /************** Statements **************/ Statements : Statement Statements | /* empty */ ; Statement : EmptyStatement | AssignExpression EmptyStatement | MethodCall EmptyStatement | IfStatement | WhileStatement | ForStatement | BodyStatement | ReturnStatement ; EmptyStatement : ';' ; BodyStatement : '{' Statements '}' ; ReturnStatement : return Expression EmptyStatement | return EmptyStatement ; /************ Expressions ****************/ Expression : MINUS Expression %prec UNARY_MINUS | UnaryExpression | AssignExpression /* assign */ | AritmExpression /* arithmetic operations */ | LogicExpression /* Logical operations */ | CondExpression /* compares */ ; UnaryExpression : '(' Expression ')' | Literal | Variable | MethodCall ; AssignExpression : IDENTIFIER EQUAL Expression | IDENTIFIER '[' Expression ']' EQUAL Expression ; AritmExpression : Expression PLUS Expression | Expression MINUS Expression | Expression MUL Expression | Expression DIV Expression ; LogicExpression : Expression AND Expression | Expression OR Expression ; CondExpression : NOT Expression %prec NOT_LOGIC | Expression EQUAL_EQUAL Expression | Expression MORE_THAN Expression | Expression MORE_EQUAL Expression | Expression LESS_THAN Expression | Expression LESS_EQUAL Expression | Expression NOT_EQUAL Expression | Expression AND_AND Expression | Expression OR_OR Expression ; 38 E200301-01-314-V10.0I-01
  41. 41. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. MoreExpression : ',' Expression MoreExpression | /* empty */ ; /************ MethodCall ****************/ MethodCall : Variable '(' ArgumentList ')' | Variable '(' ')' ; /************ ListArguments ****************/ ArgumentList : Expression | ArgumentList ',' Expression ; /************* IfStatement ******************/ IfStatement : if '(' Expression ')' Statement ElseStatement ; ElseStatement : ELSE Statement | /* empty */ ; /************* WhileStatement ******************/ WhileStatement : while '(' Expression ')' Statement ; /************* ForStatement ******************/ ForStatement : for '(' ForIniExpression ';' ForCondExpression ';' ForPostExpression ')' Statement ; ForIniExpression : StatementExpressionList | /* empty */ ; ForPostExpression : StatementExpressionList | /* empty */ ; StatementExpressionList : Expression MoreExpression ; ForCondExpression : Expression | /* empty */ ; 39 E200301-01-314-V10.0I-01
  42. 42. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) /************* Variable ******************/ Variable : Variable '.' IDENTIFIER | IDENTIFIER | IDENTIFIER '[' Expression ']' ; /************* Location ******************/ Location : Location '.' IDENTIFIER | IDENTIFIER ; /************* Literal ******************/ Literal : CONST_INT | CONST_FLOAT | STRING | true | false | GranularityType | NO_DATA_VALUE | VAR_IDENTIFIER ; GranularityType : DAILY | FIVE_MINUTES | HOURLY | HOUR_QUARTERLY | MONTHLY | ONE_MINUTE | WEEKLY ; 40 E200301-01-314-V10.0I-01
  43. 43. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 5.2 Report Samples 5.2.1 Time Evolution Report This report uses detailed (15 minutes) data and provides its (time) evolution over the specified date interval. // // dest_tevl.sc // // Time Evolution DEST Report - Source File // // Copyright (C) Siemens S.A. 2000 // All Rights Reserved // // Redistribution and use in source and binary forms are not permitted // without an express written permission from Siemens S.A.. // Advertising materials and other materials related to any // distribution or use of this software must be acknowledge that // the same was developed by Siemens S.A. and the above copyright // must be duplicated in all such forms and any documentation. // The name of Siemens S.A. may not be used to endorse or promote // products derived from this software. This software is provided // without any warranties, including, without limitation, the implied // warranties of merchantibility and fitness for a particular purpose. // request dest_request { classname = "DESTOC"; objects = $OBJECTS; counters = "DEST:CC;DEST:CS_WA;DEST:TV;DEST:TV_WA;DEST:CC_IP"; periodbegin = $PERIOD_BEGIN; periodend = $PERIOD_END; granularity = HOUR_QUARTERLY; // in seconds = 15 minutes datatype = DETAILED; } // Result expected result dest_tevl_result { } report r1() { column c_aux, c_CC, c_CCWA; int i; for ( i = 0; i < dest_request.getNumberOfObjects(); i=i+1 ) { c_CC = dest_request.getColumn("DEST:CC", i )+ dest_request.getColumn("DEST:CC_IP", i ); dest_tevl_result.addColumn("CallsCarr", dest_request.getObjectReference(i), "Nr", c_CC.getResultColumn()); c_CCWA = dest_request.getColumn("DEST:CS_WA", i ) ; dest_tevl_result.addColumn("CallsCWthAns", dest_request.getObjectReference(i), "Nr", c_CCWA.getResultColumn()); c_aux = dest_request.getColumn("DEST:TV", i ) / HOUR_QUARTERLY ; dest_tevl_result.addColumn("TrafCarr", dest_request.getObjectReference(i), "Erl", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:TV_WA", i ) / HOUR_QUARTERLY ; dest_tevl_result.addColumn("TrafCWthAns", dest_request.getObjectReference(i), "Erl", c_aux.getResultColumn()); c_aux = (c_CC / c_CCWA)* 100; dest_tevl_result.addColumn("ASR", dest_request.getObjectReference(i), "%", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:TV", i ) / c_CC; dest_tevl_result.addColumn("MHT", dest_request.getObjectReference(i), "sec", c_aux.getResultColumn()); 41 E200301-01-314-V10.0I-01
  44. 44. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) c_aux = dest_request.getColumn("DEST:TV_WA", i ) / c_CCWA; dest_tevl_result.addColumn("MHTWthAns", dest_request.getObjectReference(i), "sec", c_aux.getResultColumn()); } } 42 E200301-01-314-V10.0I-01
  45. 45. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 5.2.2 Daily Totals Report This report uses historical data and provides the daily statistics for the specified date interval. // // dest_dtot.sc // // Daily Totals DEST Report - Source File // // Copyright (C) Siemens S.A. 2000 // All Rights Reserved // // Redistribution and use in source and binary forms are not permitted // without an express written permission from Siemens S.A.. // Advertising materials and other materials related to any // distribution or use of this software must be acknowledge that // the same was developed by Siemens S.A. and the above copyright // must be duplicated in all such forms and any documentation. // The name of Siemens S.A. may not be used to endorse or promote // products derived from this software. This software is provided // without any warranties, including, without limitation, the implied // warranties of merchantibility and fitness for a particular purpose. // request dest_request { classname = "DESTOC"; objects = $OBJECTS; counters = "DEST:CC;DEST:CS_WA;DEST:TV;DEST:TV_WA;DEST:CC_IP"; periodbegin = $PERIOD_BEGIN; periodend = $PERIOD_END; granularity = DAILY; datatype = HISTORICAL_TOTALS; } // Result expected result dest_dtot_result { } report r1() { column c_aux, c_CC, c_CCWA; int i; for ( i = 0; i < dest_request.getNumberOfObjects(); i=i+1 ) { c_CC = dest_request.getColumn("DEST:CC", i )+ dest_request.getColumn("DEST:CC_IP", i ); dest_dtot_result.addColumn("CallsCarr", dest_request.getObjectReference(i), "Nr", c_CC.getResultColumn()); c_CCWA = dest_request.getColumn("DEST:CS_WA", i ) ; dest_dtot_result.addColumn("CallsCWthAns", dest_request.getObjectReference(i), "Nr", c_CCWA.getResultColumn()); c_aux = dest_request.getColumn("DEST:TV", i ) / DAILY ; dest_dtot_result.addColumn("TrafCarr", dest_request.getObjectReference(i), "Erl", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:TV_WA", i ) / DAILY; dest_dtot_result.addColumn("TrafCWthAns", dest_request.getObjectReference(i), "Erl", c_aux.getResultColumn()); c_aux = (c_CC / c_CCWA)* 100; dest_dtot_result.addColumn("ASR", dest_request.getObjectReference(i), "%", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:TV", i ) / c_CC; dest_dtot_result.addColumn("MHT", dest_request.getObjectReference(i), "sec", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:TV_WA", i ) / c_CCWA; dest_dtot_result.addColumn("MHTWthAns", dest_request.getObjectReference(i), "sec", c_aux.getResultColumn()); } } 43 E200301-01-314-V10.0I-01
  46. 46. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 5.2.3 SPBH Daily Peak Report This report uses historical data and provides the SPBH values. One sample (per day) is presen-ted for each selected object. // // dest_spbh_daily.sc // // Daily PBH DEST Report - Source File // // Copyright (C) Siemens S.A. 2000 // All Rights Reserved // // Redistribution and use in source and binary forms are not permitted // without an express written permission from Siemens S.A.. // Advertising materials and other materials related to any // distribution or use of this software must be acknowledge that // the same was developed by Siemens S.A. and the above copyright // must be duplicated in all such forms and any documentation. // The name of Siemens S.A. may not be used to endorse or promote // products derived from this software. This software is provided // without any warranties, including, without limitation, the implied // warranties of merchantibility and fitness for a particular purpose. // request dest_request { classname = "DESTOC"; objects = $OBJECTS; counters = "DEST:CU_CONG;DEST:CU_NCB;DEST:CU_NTB;DEST:CU_TI;DEST:CC;DEST:CS_WA; DEST:TV;DEST:TV_WA;DEST:CS_ID;DEST:CS_UA;DEST:CS_SB;DEST:CS_ETI; DEST:CS_ITI;DEST:CC_IP;DEST:CU_IPREJ"; periodbegin = $PERIOD_BEGIN; periodend = $PERIOD_END; granularity = DAILY; datatype = HISTORICAL_SPBH; } // Result expected result dest_spbh_daily_result { } report r1() { column c_aux; int i; for ( i = 0; i < dest_request.getNumberOfObjects(); i=i+1 ) { c_aux = dest_request.getColumn("DEST:CC", i ) + dest_request.getColumn("DEST:CC_IP", i ); dest_spbh_daily_result.addColumn("CallsCarr", dest_request.getObjectReference(i), "Nr", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:CS_WA", i ) ; dest_spbh_daily_result.addColumn("CallsCWthAns", dest_request.getObjectReference(i), "Nr", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:TV", i ) / HOURLY ; dest_spbh_daily_result.addColumn("TrafCarr", dest_request.getObjectReference (i), "Erl", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:TV_WA", i ) / HOURLY ; dest_spbh_daily_result.addColumn("TrafCWthAns", dest_request.getObjectReference (i), "Erl", c_aux.getResultColumn()); c_aux = ( dest_request.getColumn("DEST:CS_WA", i ) / dest_request.getColumn("DEST:CC", i ) ) * 100; dest_spbh_daily_result.addColumn("ASR", dest_request.getObjectReference (i), "%", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:TV", i ) / dest_request.getColumn("DEST:CC", i ) ; dest_spbh_daily_result.addColumn("MHT", dest_request.getObjectReference (i), "sec", c_aux.getResultColumn()); 44 E200301-01-314-V10.0I-01
  47. 47. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. c_aux = dest_request.getColumn("DEST:TV_WA", i ) / dest_request.getColumn("DEST:CS_WA", i ) ; dest_spbh_daily_result.addColumn("MHTWthAns", dest_request.getObjectReference (i), "sec", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:CS_ID", i ); dest_spbh_daily_result.addColumn("CallsWthIncDial", dest_request.getObjectReference (i), "Nr", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:CS_UA", i ); dest_spbh_daily_result.addColumn("CallsWthNoAns", dest_request.getObjectReference (i), "Nr", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:CS_SB", i ); dest_spbh_daily_result.addColumn("CallsSubsBusy", dest_request.getObjectReference (i), "Nr", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:CS_ETI", i ) + dest_request.getColumn("DEST:CS_ITI", i ); dest_spbh_daily_result.addColumn("CallsTechIrreg", dest_request.getObjectReference (i), "Nr", c_aux.getResultColumn()); c_aux = dest_request.getColumn("DEST:CU_CONG", i ) + dest_request.getColumn("DEST:CU_NCB", i ) + dest_request.getColumn("DEST:CU_NTB", i ) + dest_request.getColumn("DEST:CU_TI", i ) + dest_request.getColumn("DEST:CU_IPREJ", i ); dest_spbh_daily_result.addColumn("RejectedCalls", dest_request.getObjectReference (i), "Nr", c_aux.getResultColumn()); } } 45 E200301-01-314-V10.0I-01
  48. 48. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 5.2.4 SPBH Max Peak Report This report uses historical data and provides the highest SPBH value (for each selected object) within the specified interval. // // dest_spbh_max.sc // // MAX PBH DEST Report - Source File // // Copyright (C) Siemens S.A. 2000 // All Rights Reserved // // Redistribution and use in source and binary forms are not permitted // without an express written permission from Siemens S.A.. // Advertising materials and other materials related to any // distribution or use of this software must be acknowledge that // the same was developed by Siemens S.A. and the above copyright // must be duplicated in all such forms and any documentation. // The name of Siemens S.A. may not be used to endorse or promote // products derived from this software. This software is provided // without any warranties, including, without limitation, the implied // warranties of merchantibility and fitness for a particular purpose. // request dest_request { classname = "DESTOC"; objects = $OBJECTS; counters = "DEST:CU_CONG;DEST:CU_NCB;DEST:CU_NTB;DEST:CU_TI;DEST:CC;DEST:CS_WA; DEST:TV;DEST:TV_WA;DEST:CS_ID;DEST:CS_UA;DEST:CS_SB;DEST:CS_ETI; DEST:CS_ITI;DEST:CC_IP;DEST:CU_IPREJ"; periodbegin = $PERIOD_BEGIN; periodend = $PERIOD_END; granularity = DAILY; datatype = HISTORICAL_SPBH; } // Result expected result dest_spbh_max_result { } report r1() { column c_aux; result_column ref_pbh; int i; for ( i = 0; i < dest_request.getNumberOfObjects(); i=i+1 ) { c_aux = dest_request.getColumn("DEST:CC", i ) + dest_request.getColumn("DEST:CC_IP", i ); ref_pbh = c_aux.maxTimeValue(); dest_spbh_max_result.addColumn("CallsCarr", dest_request.getObjectReference (i), "Nr", ref_pbh); c_aux = dest_request.getColumn("DEST:CS_WA", i ) ; dest_spbh_max_result.addColumn("CallsCWthAns", dest_request.getObjectReference (i), "Nr", c_aux.getRelatedValues( ref_pbh)); c_aux = dest_request.getColumn("DEST:TV", i ) / HOURLY ; dest_spbh_max_result.addColumn("TrafCarr", dest_request.getObjectReference (i), "Erl", c_aux.getRelatedValues( ref_pbh )); c_aux = dest_request.getColumn("DEST:TV_WA", i ) / HOURLY ; dest_spbh_max_result.addColumn("TrafCWthAns", "EXCHOC", dest_request.getObjectReference (i), "Erl", c_aux.getRelatedValues( ref_pbh )); c_aux = ( dest_request.getColumn("DEST:CS_WA", i ) / dest_request.getColumn("DEST:CC", i ) ) * 100; dest_spbh_max_result.addColumn("ASR", dest_request.getObjectReference (i), "%", c_aux.getRelatedValues( ref_pbh )); c_aux = dest_request.getColumn("DEST:TV", i ) / dest_request.getColumn("DEST:CC", i ) ; dest_spbh_max_result.addColumn("MHT", dest_request.getObjectReference (i), "sec", c_aux.getRelatedValues( ref_pbh )); 46 E200301-01-314-V10.0I-01
  49. 49. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. c_aux = dest_request.getColumn("DEST:TV_WA", i ) / dest_request.getColumn("DEST:CS_WA", i ) ; dest_spbh_max_result.addColumn("MHTWthAns", dest_request.getObjectReference (i), "sec", c_aux.getRelatedValues( ref_pbh )); c_aux = dest_request.getColumn("DEST:CS_ID", i ); dest_spbh_max_result.addColumn("CallsWthIncDial", dest_request.getObjectReference (i), "Nr", c_aux.getRelatedValues( ref_pbh )); c_aux = dest_request.getColumn("DEST:CS_UA", i ); dest_spbh_max_result.addColumn("CallsWthNoAns", dest_request.getObjectReference (i), "Nr", c_aux.getRelatedValues( ref_pbh )); c_aux = dest_request.getColumn("DEST:CS_SB", i ); dest_spbh_max_result.addColumn("CallsSubsBusy", dest_request.getObjectReference (i), "Nr", c_aux.getRelatedValues( ref_pbh )); c_aux = dest_request.getColumn("DEST:CS_ETI", i ) + dest_request.getColumn("DEST:CS_ITI", i ); dest_spbh_max_result.addColumn("CallsTechIrreg", dest_request.getObjectReference (i), "Nr", c_aux.getRelatedValues( ref_pbh )); c_aux = dest_request.getColumn("DEST:CU_CONG", i ) + dest_request.getColumn("DEST:CU_NCB", i ) + dest_request.getColumn("DEST:CU_NTB", i ) + dest_request.getColumn("DEST:CU_TI", i ) + dest_request.getColumn("DEST:CU_IPREJ", i ); dest_spbh_max_result.addColumn("RejectedCalls", dest_request.getObjectReference (i), "Nr", c_aux.getRelatedValues( ref_pbh )); } } 47 E200301-01-314-V10.0I-01
  50. 50. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 5.2.5 Top n Report This report uses the daily total statistics (historical data) and provides, for the specified date interval, the 10 objects with the highest values of the indicator “PVC unavailability ratio”. // // pvc_avl_top10_dtot.sc // // Top 10 Daily Totals ATM PVC Availability Report - Source File // // Copyright (C) Siemens S.A. 2000 // All Rights Reserved // // Redistribution and use in source and binary forms are not permitted // without an express written permission from Siemens S.A.. // Advertising materials and other materials related to any // distribution or use of this software must be acknowledge that // the same was developed by Siemens S.A. and the above copyright // must be duplicated in all such forms and any documentation. // The name of Siemens S.A. may not be used to endorse or promote // products derived from this software. This software is provided // without any warranties, including, without limitation, the implied // warranties of merchantibility and fitness for a particular purpose. // request all_pvc_request { classname = "ATMPVCOC"; objects = $OBJECTS; counters = "ATMPVCAVL:AVL;ATMPVCAVL:UAVL"; periodbegin = $PERIOD_BEGIN; // Only one day period - begining periodend = $PERIOD_END; // Only one day period - end granularity = DAILY; datatype = HISTORICAL_TOTALS; } request pvc_request { classname = "ATMPVCOC"; objects = $OBJ1_PVC, $OBJ2_PVC, $OBJ3_PVC, $OBJ4_PVC, $OBJ5_PVC, $OBJ6_PVC, $OBJ7_PVC, $OBJ8_PVC, $OBJ9_PVC, $OBJ10_PVC; counters = "ATMPVCAVL:MNT;ATMPVCAVL:NOUTM;ATMPVCAVL:NOUTF"; periodbegin = $PERIOD_BEGIN; // Only one day period - begining periodend = $PERIOD_END; // Only one day period - end granularity = DAILY; datatype = HISTORICAL_TOTALS; } // Result expected result pvc_avl_result { } method UnavlRatio (column c_avl, column c_unavl) return column { return (c_unavl / (c_avl + c_unavl) * 100); } method TotalNbrOutages (column c_noutf, column c_noutm) return column { return (c_noutf + c_noutm); } report r1() { column c_pvcavl; column c_pvcunavl; column c_pvcavl_ratio; int i, pos_max1, pos_max2, pos_max3, pos_max4, pos_max5, pos_max6, pos_max7, pos_max8, pos_max9, pos_max10; double aux_val, aux_swap, max1, max2, max3, max4, max5, max6, max7, max8, max9, max10; max1=0; max2=0; max3=0; max4=0; 48 E200301-01-314-V10.0I-01
  51. 51. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. max5=0; max6=0; max7=0; max8=0; max9=0; max10=0; for ( i = 0; i < all_pvc_request.getNumberOfObjects(); i=i+1 ) { c_pvcavl = all_pvc_request.getColumn("ATMPVCAVL:AVL", i); c_pvcunavl = all_pvc_request.getColumn("ATMPVCAVL:UAVL",i); c_pvcavl_ratio = UnavlRatio (c_pvcavl, c_pvcunavl); aux_val = c_pvcavl_ratio.getValue(c_pvcavl_ratio.getDate(0)); // getDate(0) because there is only one day if (aux_val == NO_DATA_VALUE) aux_val=0; if (max1 < aux_val) { aux_swap= aux_val; aux_val = max1; max1 = aux_swap; pos_max1 = i; } if (max2 < aux_val) { aux_swap= aux_val; aux_val = max2; max2 = aux_swap; pos_max2 = i; } if (max3 < aux_val) { … } if (max10 < aux_val) { max10 = aux_swap; pos_max10 = i; } } if (max1==0) misc_lib.error("Not able to execute the report, not enough data"); c_pvcavl = all_pvc_request.getColumn("ATMPVCAVL:AVL", pos_max1); pvc_avl_result.addColumn("AvlTime", all_pvc_request.getObjectReference (pos_max1), "Sec", c_pvcavl.getResultColumn()); c_pvcunavl = all_pvc_request.getColumn("ATMPVCAVL:UAVL", pos_max1); pvc_avl_result.addColumn("UnavlTime", all_pvc_request.getObjectReference (pos_max1), "Sec", c_pvcunavl.getResultColumn()); c_pvcavl_ratio = UnavlRatio (c_pvcavl, c_pvcunavl); pvc_avl_result.addColumn("%UnavlTime", all_pvc_request.getObjectReference (pos_max1), "%", c_pvcavl_ratio.getResultColumn()); misc_lib.defineVariable("$OBJ1_PVC", all_pvc_request.getObjectName(pos_max1) ); if (max2!=0) { c_pvcavl = all_pvc_request.getColumn("ATMPVCAVL:AVL", pos_max2); pvc_avl_result.addColumn("AvlTime", all_pvc_request.getObjectReference (pos_max2), "Sec", c_pvcavl.getResultColumn()); c_pvcunavl = all_pvc_request.getColumn("ATMPVCAVL:UAVL", pos_max2); pvc_avl_result.addColumn("UnavlTime", all_pvc_request.getObjectReference (pos_max2), "Sec", c_pvcunavl.getResultColumn()); c_pvcavl_ratio = UnavlRatio (c_pvcavl, c_pvcunavl); pvc_avl_result.addColumn("%UnavlTime", all_pvc_request.getObjectReference (pos_max2), "%", c_pvcavl_ratio.getResultColumn()); misc_lib.defineVariable("$OBJ2_PVC", all_pvc_request.getObjectName(pos_max2) ); } if (max3!=0) { … 49 E200301-01-314-V10.0I-01
  52. 52. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) } if (max10!=0) { c_pvcavl = all_pvc_request.getColumn("ATMPVCAVL:AVL", pos_max10); pvc_avl_result.addColumn("AvlTime", all_pvc_request.getObjectReference (pos_max10), "Sec", c_pvcavl.getResultColumn()); c_pvcunavl = all_pvc_request.getColumn("ATMPVCAVL:UAVL", pos_max10); pvc_avl_result.addColumn("UnavlTime", all_pvc_request.getObjectReference (pos_max10), "Sec", c_pvcunavl.getResultColumn()); c_pvcavl_ratio = UnavlRatio (c_pvcavl, c_pvcunavl); pvc_avl_result.addColumn("%UnavlTime", all_pvc_request.getObjectReference (pos_max10), "%", c_pvcavl_ratio.getResultColumn()); misc_lib.defineVariable("$OBJ10_PVC", all_pvc_request.getObjectName(pos_max10) ); } all_pvc_request.unload(); pvc_request.load(); } report r2() { column c_pvcmnt; column c_pvcnoutf; column c_pvcnoutm; column c_pvcnout_tot; int i; for ( i = 0; i < pvc_request.getNumberOfObjects(); i=i+1 ) { // For the top 10 unavailable pvcs c_pvcmnt = pvc_request.getColumn("ATMPVCAVL:MNT", i); pvc_avl_result.addColumn("MaintTime", pvc_request.getObjectReference (i), "Sec", c_pvcmnt.getResultColumn()); c_pvcnoutf = pvc_request.getColumn("ATMPVCAVL:NOUTF", i); pvc_avl_result.addColumn("NbrFailOutages", pvc_request.getObjectReference (i), "Nr", c_pvcnoutf.getResultColumn()); c_pvcnoutm = pvc_request.getColumn("ATMPVCAVL:NOUTM", i); pvc_avl_result.addColumn("NbrMaintOutages", pvc_request.getObjectReference (i), "Nr", c_pvcnoutm.getResultColumn()); c_pvcnout_tot = TotalNbrOutages (c_pvcnoutf, c_pvcnoutm); pvc_avl_result.addColumn("TotalNbrOutages", pvc_request.getObjectReference (i), "Nr", c_pvcnout_tot); } } 50 E200301-01-314-V10.0I-01
  53. 53. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 5.2.6 Day Periods Time Evolution Report This report uses detailed data (15 minutes granularity) and provides its (time) evolution over the specified date interval for three time periods: morning (from 09:00 to 11:00), afternoon (from 14:00 to 16:00) and night (from 20:00 to 22:00). // // dest_day_period_tevl.sc // // Daily Period Time Evolution DEST Report - Source File // // Copyright (C) Siemens S.A. 2000 // All Rights Reserved // // Redistribution and use in source and binary forms are not permitted // without an express written permission from Siemens S.A.. // Advertising materials and other materials related to any // distribution or use of this software must be acknowledge that // the same was developed by Siemens S.A. and the above copyright // must be duplicated in all such forms and any documentation. // The name of Siemens S.A. may not be used to endorse or promote // products derived from this software. This software is provided // without any warranties, including, without limitation, the implied // warranties of merchantibility and fitness for a particular purpose. // request dest_request { classname = "DESTOC"; objects = $OBJECTS; counters = "DEST:CC;DEST:CS_WA"; periodbegin = $PERIOD_BEGIN; periodend = $PERIOD_END; granularity = HOUR_QUARTERLY; // in seconds = 15 minutes datatype = DETAILED; } // Result expected result dest_test_result { } report r1() { column c_aux, c_CC, c_CSWA; result_column c_I1,c_I2,c_I3; int i,j, k; double acc; for ( i = 0; i < dest_request.getNumberOfObjects(); i=i+1 ) { c_CC = dest_request.getColumn("DEST:CC", i ); c_CSWA = dest_request.getColumn("DEST:CS_WA", i ) ; // Execute the formula with the resulting rows c_aux = (c_CSWA / c_CC)* 100; for ( k = 0; k < c_aux.nelem(); k=k+96 ) { // Get date for morning period j=k+35; acc = c_aux[j]; for (j= k+36 ; j < (k+43) ; j=j+1) { // Check value of the column to add to the acumulator if ( c_aux[j]!=NO_DATA_VALUE ) { // The value is valid, so verify if value IN acumulator is valid if (acc == NO_DATA_VALUE) { // The value is not valid, so initialise the acumulator to zero acc =c_aux[j]; 51 E200301-01-314-V10.0I-01
  54. 54. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) } else { // The value is valid, so execute the addition acc = acc + c_aux[j]; } } } // Add results for morning period to the c_I1 result_column c_I1.addDateValue( c_aux.getDate(k+35), acc); acc = c_aux[k+55]; for (j= k+56 ; j < (k+63) ; j=j+1) { // Check value of the column to add to the acumulator if ( c_aux[j]!=NO_DATA_VALUE ) { // The value is valid, so verify if value IN acumulator is valid if (acc == NO_DATA_VALUE) { // The value is not valid, so initialise the acumulator to zero acc =c_aux[j]; } else { // The value is valid, so execute the addition acc = acc + c_aux[j]; } } } // Add results for afternoon period to the c_I1 result_column c_I2.addDateValue(c_aux.getDate(k+35),acc); acc = c_aux[ k+79 ]; for (j= k+80 ; j < (k+87) ; j=j+1) { // Check value of the column to add to the acumulator if ( c_aux[j]!=NO_DATA_VALUE ) { // The value is valid, so verify if value IN acumulator is valid if (acc == NO_DATA_VALUE) { // The value is not valid, so initialise the acumulator to zero acc =c_aux[j]; } else { // The value is valid, so execute the addition acc = acc + c_aux[j]; } } } // Add results for night period to the c_I1 result_column c_I3.addDateValue(c_aux.getDate(k+35),acc); } //Add c_I1 result_column to final table dest_test dest_test_result.addColumn("CallComp-Morning", dest_request.getObjectReference (i), "NR", c_I1); dest_test_result.addColumn("CallComp-Aftenoon", dest_request.getObjectReference (i), "NR", c_I2); dest_test_result.addColumn("CallComp-Night", dest_request.getObjectReference (i), "NR", c_I3); // clear values c_I1.clear(); c_I2.clear(); c_I3.clear(); } } 52 E200301-01-314-V10.0I-01
  55. 55. Report Processing Language (SPOTS V10 Drop 4) Siemens S.A. 6 References [01] User Manual SPOTS V10 (SSA Doc E200301-01-114-V10.0I-*) 53 E200301-01-314-V10.0I-01
  56. 56. Siemens S.A. Report Processing Language (SPOTS V10 Drop 4) 7 Glossary & Abbreviations DB Database. GUI Graphical User Interface. PBH Peak Busy Hour. PM Performance Management. SAS SPOTS Application Server. SCL SPOTS Client application. SOC Set of Counters. SOO Set of Objects. SPBH Sample at PBH. SPOTS PM Tool. SRL SPOTS Reporting Language. TCBH Time Consistent Consistent Busy Hour. It is defined (for an interval of days) as the PBH of the "average day". Each va-lue of this "average day" is computed as the average of the corresponding daily detailed values (e.g., the first detailed value of the "average day" is obtained di-viding, by the number of days of the interval, the sum of all daily values related to the first scantime interval). TGRP Trunk Group. VC Virtual Counter. 54 E200301-01-314-V10.0I-01

×