DataMuseum.dk

Presents historical artifacts from the history of:

Rational R1000/400 Tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about Rational R1000/400 Tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: B T

⟦af8db1325⟧ TextFile

    Length: 5323 (0x14cb)
    Types: TextFile
    Names: »B«

Derivation

└─⟦180fe333a⟧ Bits:30000405 8mm tape, Rational 1000, SW CATALOG, 10_20_0
└─⟦180fe333a⟧ Bits:30000537 8mm tape, Rational 1000, SW Catalog 10_20_0
    └─⟦5cb1d1d7f⟧ »DATA« 
        └─⟦3b1ee7bd8⟧ 
            └─⟦this⟧ 

TextFile

with Io;
with Directory_Tools;
with Library;
with Table_Formatter;
with Transport_Name;
with Time_Utilities;
with Log;
with Profile;
procedure Subsystem_Space_Report
             (For_Subsystems : String := ">>SUBSYSTEM_NAMES<<";
              Output : String := "") is

    package Object renames Directory_Tools.Object;
    package Naming renames Directory_Tools.Naming;
    package Statistics renames Directory_Tools.Statistics;

    Subsystem_Iter : Object.Iterator := Naming.Resolution (For_Subsystems);
    Subsystem_Handle : Object.Handle;
    Space_Iter : Object.Iterator;
    Total_Size : Long_Integer := 0;
    Ok : Boolean := False;
    Dup : Boolean;
    Output_File : Io.File_Type;

    Overhead_Total, Specs_Total, Working_Total, Releases_Total :
       Long_Integer := 0;

    package Table is new Table_Formatter (Number_Of_Columns => 6);

    procedure Get_Size (For_Objects : Object.Iterator;
                        Size : out Long_Integer;
                        Worked : out Boolean) is
        Result : Long_Integer := 0;
        Local_Iter : Object.Iterator := For_Objects;
    begin
        Worked := True;
        Size := 0;
        while not Object.Done (For_Objects) loop
            Result := Result + Statistics.Total_Size
                                  (Object.Value (Local_Iter));
            Object.Next (Local_Iter);
        end loop;
        Size := Result;
    exception
        when Numeric_Error =>
            Worked := False;
    end Get_Size;

    procedure Put_Size (Size : Long_Integer; Data_Is_Good : Boolean) is
    begin
        if Data_Is_Good then
            Table.Item (Long_Integer'Image (Size / (8 * 1024)));
        else
            Table.Item ("****");
        end if;
    end Put_Size;

begin
    if Output = "" then
        Output_File := Io.Current_Output;
    else
        begin
            Io.Create (Output_File, Io.Out_File, Output);  
        exception
            when Io.Name_Error =>
                Log.Put_Line ("ERROR - Output file could not be created",
                              Profile.Negative_Msg);
                return;
        end;
    end if;

    Table.Header ("Subsystem", Table.Left);
    Table.Header ("Overhead", Table.Right);
    Table.Header ("Specs", Table.Right);
    Table.Header ("Working", Table.Right);
    Table.Header ("Releases", Table.Right);
    Table.Header ("Context", Table.Left);
    while not (Object.Done (Subsystem_Iter)) loop
        Subsystem_Handle := Object.Value (Subsystem_Iter);
        if Object.Image (Object.Subclass_Of (Subsystem_Handle)) /=
           "SUBSYSTEM" then
            Io.Put_Line (Naming.Simple_Name (Subsystem_Handle) &
                         " IS NOT A SUBSYSTEM.");
        else  
            Table.Item (Naming.Simple_Name (Subsystem_Handle));
            Space_Iter := Naming.Resolution
                             (Naming.Full_Name (Subsystem_Handle) &
                              ".[Configurations,State]??");
            Object.Add (Space_Iter, Subsystem_Handle, Dup);
            Get_Size (For_Objects => Space_Iter,
                      Size => Total_Size,
                      Worked => Ok);
            Overhead_Total := Overhead_Total + Total_Size;
            Put_Size (Size => Total_Size, Data_Is_Good => Ok);
            Space_Iter := Naming.Resolution
                             (Naming.Full_Name (Subsystem_Handle) & ".@spec?");
            Get_Size (For_Objects => Space_Iter,
                      Size => Total_Size,
                      Worked => Ok);
            Specs_Total := Specs_Total + Total_Size;
            Put_Size (Size => Total_Size, Data_Is_Good => Ok);
            Space_Iter := Naming.Resolution
                             (Naming.Full_Name (Subsystem_Handle) &
                              ".@working?");
            Get_Size (For_Objects => Space_Iter,
                      Size => Total_Size,
                      Worked => Ok);
            Working_Total := Working_Total + Total_Size;
            Put_Size (Size => Total_Size, Data_Is_Good => Ok);
            Space_Iter := Naming.Resolution
                             (Naming.Full_Name (Subsystem_Handle) &
                              ".[@,~@spec,~@working,~configurations,~state]?");
            Get_Size (For_Objects => Space_Iter,
                      Size => Total_Size,
                      Worked => Ok);
            Releases_Total := Releases_Total + Total_Size;
            Put_Size (Size => Total_Size, Data_Is_Good => Ok);
            Table.Item (Naming.Prefix (Naming.Full_Name (Subsystem_Handle)));
        end if;
        Object.Next (Subsystem_Iter);
    end loop;
    Table.Item ("TOTALS");
    Put_Size (Overhead_Total, True);
    Put_Size (Specs_Total, True);
    Put_Size (Working_Total, True);
    Put_Size (Releases_Total, True);
    Put_Size
       (Overhead_Total + Specs_Total + Working_Total + Releases_Total, True);

    Io.Put_Line (Output_File,
                 "Subsystem Space Report generated on " &
                    Time_Utilities.Image (Time_Utilities.Get_Time));
    Io.Put_Line (Output_File, "For Subsystems => " & For_Subsystems);
    Io.Put_Line (Output_File, "Machine Name => " &
                                 Transport_Name.Local_Host_Name ("tcp/ip"));
    Io.New_Line;
    Table.Display (Output_File);
end Subsystem_Space_Report;