DIRECTORY DB, Rope, IO, Commander, CommandTool; WalnutStatsMonitor: CEDAR PROGRAM IMPORTS DB, Rope, IO, Commander, CommandTool = BEGIN INT: TYPE = LONG INTEGER; ROPE: TYPE = Rope.ROPE; CmdHandle: TYPE = Commander.Handle; ArgumentVector: TYPE = CommandTool.ArgumentVector; MonUser: Commander.CommandProc = { argV: ArgumentVector = CommandTool.Parse[cmd]; rel: DB.Relation; relshipSet: DB.RelshipSet; rship: DB.Relship; count: INT; opName: ROPE; msgSet1: ROPE; msgSet2: ROPE; msgCount: INT; msgSetCount: INT; transHandle: DB.TransactionHandle; schemaInvalid: BOOLEAN; userName: ROPE = argV[1]; serverFile: ROPE; IF Rope.Equal["AlisonLee",userName] OR Rope.Equal["Tempero",userName] THEN serverFile _ Rope.Cat[r1: "[ebbetts.alpine]<", r2: userName, r3: ".pa>Walnut.segment"] ELSE serverFile _ Rope.Cat[r1: "[luther.alpine]<", r2: userName, r3: ".pa>Walnut.segment"]; IO.PutF[cmd.out, "Stats for %g", IO.rope["userName"] ]; DB.Initialize[nCachePages: 100]; DB.DeclareSegment[filePath: serverFile, segment: $Walnut, readonly: TRUE, nPagesInitial: 3000, createIfNotFound: FALSE, nPagesPerExtent: 256]; [trans: transHandle, schemaInvalid: schemaInvalid] _ DB.OpenTransaction[segment: $Walnut]; IO.PutChar[cmd.out, IO.CR]; IO.PutF[cmd.out, "---------------------------- "]; IO.PutChar[cmd.out, IO.CR]; IO.PutF[cmd.out, "Basic Stats"]; IO.PutChar[cmd.out, IO.CR]; rel _ DB.LookupRelation[name: "VersionInfo" , segment: $Walnut]; IO.PutChar[cmd.out, IO.CR]; relshipSet _ DB.RelationSubset[r:rel,index:NIL,constraint:NIL]; rship _ DB.NextRelship[rs: relshipSet]; msgCount _ DB.V2I[DB.GetF[t: rship, field: 0]]; msgSetCount _ DB.V2I[DB.GetF[t: rship, field: 1]]; IO.PutF[cmd.out, "number of messages = %5g number of message sets = %5g", IO.int[msgCount], IO.int[msgSetCount]]; IO.PutChar[cmd.out, IO.CR]; IO.PutChar[cmd.out, IO.CR]; IO.PutF[cmd.out, "---------------------------- "]; IO.PutChar[cmd.out, IO.CR]; IO.PutF[cmd.out, "Size of Active And Deleted Message Sets"]; IO.PutChar[cmd.out, IO.CR]; { msgSetDomain: DB.Domain _ DB.LookupDomain[name: "MsgSet", segment: $Walnut]; activeEntity: DB.Entity _ DB.LookupEntity[d: msgSetDomain, name: "Active"]; deletedEntity: DB.Entity _ DB.LookupEntity[d: msgSetDomain, name: "Deleted"]; rel: DB.Relation _ DB.LookupRelation[name: "msBasicInfo", segment: $Walnut]; rship1: DB.Relship _ DB.LookupProperty[r: rel, e: activeEntity]; rship2: DB.Relship _ DB.LookupProperty[r: rel, e: deletedEntity]; delCount: INT _ DB.V2I[DB.GetF[t: rship, field: 0]]; actCount: INT _ DB.V2I[DB.GetF[t: rship, field: 0]]; IO.PutF[cmd.out, "%5g %5g", IO.int[delCount], IO.int[actCount]]; IO.PutChar[cmd.out, IO.CR]; }; IO.PutChar[cmd.out, IO.CR]; IO.PutF[cmd.out, "---------------------------- "]; IO.PutChar[cmd.out, IO.CR]; IO.PutF[cmd.out, "No Message Set Operations"]; IO.PutChar[cmd.out, IO.CR]; rel _ DB.LookupRelation[name: "noMsgSetsOperRelation" , segment: $Walnut]; IO.PutChar[cmd.out, IO.CR]; relshipSet _ DB.RelationSubset[r:rel,index:NIL,constraint:NIL]; DO rship _ DB.NextRelship[rs: relshipSet]; IF rship = NIL THEN EXIT; count _ DB.V2I[DB.GetF[t: rship, field: 0]]; opName _ DB.V2S[DB.GetF[t: rship, field: 1]]; IO.PutF[cmd.out, "%10g %5g", IO.rope[opName], IO.int[count]]; IO.PutChar[cmd.out, IO.CR]; ENDLOOP; IO.PutChar[cmd.out, IO.CR]; IO.PutChar[cmd.out, IO.CR]; IO.PutF[cmd.out, "---------------------------- "]; IO.PutChar[cmd.out, IO.CR]; IO.PutF[cmd.out, "Single Message Set Operations"]; IO.PutChar[cmd.out, IO.CR]; rel _ DB.LookupRelation[name: "oneMsgSetsOperRelation" , segment: $Walnut]; relshipSet _ DB.RelationSubset[r:rel,index:NIL,constraint:NIL]; DO rship _ DB.NextRelship[rs: relshipSet]; IF rship = NIL THEN EXIT; count _ DB.V2I[DB.GetF[t: rship, field: 0]]; opName _ DB.V2S[DB.GetF[t: rship, field: 1]]; msgSet1 _ DB.V2S[DB.GetF[t: rship, field: 2]]; IO.PutF[cmd.out, "%10g %10g %5g", IO.rope[opName], IO.rope[msgSet1], IO.int[count]]; IO.PutChar[cmd.out, IO.CR]; ENDLOOP; IO.PutChar[cmd.out, IO.CR]; IO.PutChar[cmd.out, IO.CR]; IO.PutF[cmd.out, "---------------------------- "]; IO.PutChar[cmd.out, IO.CR]; IO.PutF[cmd.out, "Double Message Set Operations"]; IO.PutChar[cmd.out, IO.CR]; rel _ DB.LookupRelation[name: "twoMsgSetsOperRelation" , segment: $Walnut]; relshipSet _ DB.RelationSubset[r:rel,index:NIL,constraint:NIL]; DO rship _ DB.NextRelship[rs: relshipSet]; IF rship = NIL THEN EXIT; count _ DB.V2I[DB.GetF[t: rship, field: 0]]; opName _ DB.V2S[DB.GetF[t: rship, field: 1]]; msgSet1 _ DB.V2S[DB.GetF[t: rship, field: 2]]; msgSet2 _ DB.V2S[DB.GetF[t: rship, field: 3]]; IO.PutF[cmd.out, "%10g %10g %10g %5g", IO.rope[opName], IO.rope[msgSet1], IO.rope[msgSet1], IO.int[count]]; IO.PutChar[cmd.out, IO.CR]; ENDLOOP; DB.CloseTransaction[trans: transHandle]; }; Commander.Register["MonUser", MonUser, "Monitor stats for a single walnut user"]; END.   File: WalnutStatsMonitor.mesa Contents: : monitor stats for walnut users Created by: Jack Kent, September 3, 1986 6:36:03 pm PDT serverFile is userName concatenated with the usual garbage print out general stats about number of messages and number of message set Get the List of Key Indices from the relation print out general stats about number of messages and number of message set print out number of messages in active and deleted Get the List of Key Indices from the relation Get the List of Key Indices from the relation Get the List of Key Indices from the relation Commander.Register["MonAll", MonAll, "monitor stats for all test participants"]; ÊʘJšœ™Jšœ*™*Jšœ7™7J™šÏk ˜ Jšœœ˜%J˜—šÏnœœ˜!Jšœœœ˜.J˜—Jšœ˜J˜Jšœœœœ˜Jšœœœ˜Jšœ œ˜#Jšœœ˜2J™J™J™J™J™˜J˜J˜—Jšžœ˜"˜Jšœ.˜.J˜J˜J˜Jšœœ ˜Jšœ œ ˜Jšœœ ˜Jšœœ˜ Jšœœ˜ Jšœ œ˜Jšœ œ˜Jšœ œ˜Jšœ œ˜J˜Jšœ œ˜"Jšœœ˜J˜J˜J˜Jšœ œ ˜J˜Jšœ œ˜Jšœ#œ"˜MJšœV˜VJš˜J•StartOfExpansionZ[r1: ROPE _ NIL, r2: ROPE _ NIL, r3: ROPE _ NIL, r4: ROPE _ NIL, r5: ROPE _ NIL]šœV˜VJ˜Jšœœ˜7J˜Jšœ:™:J˜Jšœ˜ J˜J˜JšœDœ)œ˜‘J˜Jšœ5œ#˜ZJ˜J˜J˜J™JJšœœœ˜Jšœ0˜2Jšœœœ˜Jšœ˜ Jšœœœ˜Jšœœ9˜AJšœœœ˜J™-Jšœ œœ œ˜?Jšœœ˜'Jšœ œœ˜/Jšœœœ˜2JšœIœœ˜rJšœœœ˜J˜J˜J™JJšœœœ˜Jšœ0˜2Jšœœœ˜Jšœ:˜Jšœœœ˜—Jšœ˜J˜Jšœœœ˜Jšœœœ˜Jšœ0˜2Jšœœœ˜Jšœ0˜2Jšœœœ˜JšœœD˜LJ™-Jšœ œœ œ˜?š˜Jšœœ˜'Jšœ œœœ˜Jšœœœ˜,Jšœ œœ˜-Jšœ œœ˜.J–([base: ROPE _ NIL, rest: ROPE _ NIL]šœ"œœœ ˜VJšœœœ˜—Jšœ˜J˜J˜Jšœœœ˜Jšœœœ˜Jšœ0˜2Jšœœœ˜Jšœ0˜2Jšœœœ˜JšœœD˜LJ™-Jšœ œœ œ˜?š˜Jšœœ˜'Jšœ œœœ˜Jšœœœ˜,Jšœ œœ˜-Jšœ œœ˜.Jšœ œœ˜.Jš œ'œœœœ ˜mJšœœœ˜J˜—Jšœ˜J˜J˜Jšœ'˜)J˜J˜J˜J˜—J˜J˜J˜J™šœ&˜&Jšœ+˜+—šœ$™$Jšœ,™,—J™J™J˜Jšœ˜˜˜J˜—˜J˜—˜J˜—J˜J˜J˜——…—ˆ