[Glass] Some more easy stats printing or production tools?

Dale Henrichs via Glass glass at lists.gemtalksystems.com
Wed Jun 10 09:44:26 PDT 2015


Well this one is a bit convoluted and I will be putting together a tODE 
command/api to make this a bit easier...

System class>>_cacheName: sets the 'ProcessName' entry in the 
cacheStatistics array in the SPC. There is a cacheStatitics array in the 
SPC for each GemStone process. Different processes have different 
entries in the cacheStatistics array .... To get the descriptions for 
the cacheStatics for a given process type you use System 
class>>cacheStatisticsDescriptionForType: (see the comment for the arg 
to use). For a gem (type 8), there are 223 cacheStats in GemStone 3.2.2 
(the stone version I happen to be working with at the moment). The first 
description is 'ProcessName' and that's where the name can be found...

To get the 'ProcessName' for your current session:

   | cacheStatValues cacheStatDescriptions myProcessName |
   cacheStatValues := System gemCacheStatisticsForSessionId: System session.
   cacheStatDescriptions := System cacheStatisticsDescriptionForType: 8.
   myProcessName := cacheStatValues at: (cacheStatDescriptions indexOf: 
'ProcessName')

You can also access cacheStatistics based on pid 
(cacheStatisticsProcessId:), by gem name (cacheStatsForGemWithName:), etc...

Dale

On 6/10/15 2:42 AM, Mariano Martinez Peck via Glass wrote:
>
>
> On Wed, Jun 10, 2015 at 3:37 AM, Johan Brichau via Glass 
> <glass at lists.gemtalksystems.com 
> <mailto:glass at lists.gemtalksystems.com>> wrote:
>
>     You can set the gem description like this in it’s ‘startup script’
>     (Smalltalk part:)
>
>     System _cacheName: '$1_$2’.
>
>     The $1 and $2 are env vars in my script that contain the adaptor
>     name and port.
>     I think this is also in the standard startSeaside30_Adaptor script
>     but I don’t know for sure.
>
>
> Thanks Johan, that was kind of what I was looking for. It seems the 
> startSeaside30_Adaptor does indeed the thing:
>
> System _cacheName: ((x := '$1-' , (GsSession serialOfSession: System 
> session) printString , '-' , System myUserProfile userId) copyFrom: 1 
> to: (x size min: 31)).
>
> I put a transcript show in there and it should be setting something 
> like 'FastCGI_service-140-userxxx', which is correct.
> The problem is that my session descriptions still does not show it. 
> See below.
>
>     This way, the session name shows up in the stats and should be
>     available where you are looking for it as well I believe.
>
>
> Where? Where it displays the session name in the stats? From 
> #descriptionOfSession: I do not see it in any field...
>
> Thanks!
>
>
>     Johan
>
>>     On 10 Jun 2015, at 08:31, Mariano Martinez Peck via Glass
>>     <glass at lists.gemtalksystems.com
>>     <mailto:glass at lists.gemtalksystems.com>> wrote:
>>
>>
>>
>>     On Tue, Jun 9, 2015 at 2:02 PM, Dale Henrichs via
>>     Glass<glass at lists.gemtalksystems.com
>>     <mailto:glass at lists.gemtalksystems.com>>wrote:
>>
>>         Mariano,
>>
>>         Great idea!
>>
>>         I took a look at the `gs` command in tODE and here are a
>>         couple of more things that you could provide:
>>
>>         System gemConfigurationReport.
>>         System stoneConfigurationReport.
>>         System clientVersionReport.
>>         System clientVersionReport.
>>         System clientVersionReport.
>>
>>         "The following provides a desription for the current gemstone
>>         gem. `System currentSessions` provides
>>         list of all sessionIds in system, so you could also generate
>>         a table of all sessions and their description"
>>
>>
>>     Hi Dale,
>>
>>     Is there a way to know which are the seaside gems and the seaside
>>     maintenance gem from such a list? Watching the description and
>>     everything, I cannot find an easy way of knowing it. The only
>>     thing is the gem pid. But then it is not that easy for me to know
>>     if such a pid is a seaside gem or not.
>>
>>     Is there a way? I would like to list the seaside gems and their
>>     status (if at least one seaside gem works)... (I am thinking if I
>>     could do a http request over the exact port and check on
>>     timeout).  mmmm maybe I can do a "System perform: " over the
>>     monit status. grrrr gemstone doesn't have permissions to execute
>>     monit..grr. Ok, I will see... but any idea is appreciated.
>>
>>     Cheers,
>>
>>
>>     Thanks
>>
>>         | sessionId ar |
>>         sessionId := System session.
>>         ar := System descriptionOfSession: sessionId.
>>         ^ Dictionary new
>>         at: #'userProfile' put: (ar at: 1);
>>         at: #'gemPid' put: (ar at: 2);
>>         at: #'gemHost' put: (ar at: 3);
>>         at: #'gemPrimitiveNumber' put: (ar at: 4);
>>         at: #'mostRecentTransactionTime' put: (ar at: 5);
>>         at: #'sessionState' put: (ar at: 6);
>>         at: #'transactionMode' put: (ar at: 7);
>>         at: #'onOldestCommitRecord' put: (ar at: 8);
>>         at: #'sessionSerialNumber' put: (ar at: 9);
>>         at: #'sessionId' put: (ar at: 10);
>>         at: #'gciHostIP' put: (ar at: 11);
>>         at: #'sessionPriority' put: (ar at: 12);
>>         at: #'gciUniqueHostId' put: (ar at: 13);
>>         at: #'mostRecetStoneRequest' put: (ar at: 14);
>>         at: #'sessionLoginTime' put: (ar at: 15);
>>         at: #'systemCommitsSinceSessionView' put: (ar at: 16);
>>         at: #'systemDescription' put: (ar at: 17);
>>         at: #'numTempObjIds' put: (ar at: 18);
>>         at: #'numTempPageIds' put: (ar at: 19);
>>         at: #'sessionVoteState' put: (ar at: 20);
>>         yourself
>>
>>         Dale
>>
>>
>>         On 06/09/2015 09:46 AM, Mariano Martinez Peck via Glass wrote:
>>>         Hi guys,
>>>
>>>         I am adding some WEB tools for those users which are very
>>>         admin or developers to my app. So far I added WAObjectLog
>>>         and now a simple component that renders the result of
>>>         "(Smalltalk at: #SystemRepository) fileSizeReport. "
>>>         I wonder which other kind of easy stats or production tool I
>>>         might be missing.
>>>         If there is something else that could be of use to me,
>>>         please let me know. I want to provide as much as possible I
>>>         have at hand for a small amount of effort, to my admin users.
>>>
>>>         Thanks in advance,
>>>
>>>         --
>>>         Mariano
>>>         http://marianopeck.wordpress.com
>>>         <http://marianopeck.wordpress.com/>
>>>
>>>
>>>         _______________________________________________
>>>         Glass mailing list
>>>         Glass at lists.gemtalksystems.com  <mailto:Glass at lists.gemtalksystems.com>
>>>         http://lists.gemtalksystems.com/mailman/listinfo/glass
>>
>>
>>         _______________________________________________
>>         Glass mailing list
>>         Glass at lists.gemtalksystems.com
>>         <mailto:Glass at lists.gemtalksystems.com>
>>         http://lists.gemtalksystems.com/mailman/listinfo/glass
>>
>>
>>
>>
>>     --
>>     Mariano
>>     http://marianopeck.wordpress.com <http://marianopeck.wordpress.com/>
>>     _______________________________________________
>>     Glass mailing list
>>     Glass at lists.gemtalksystems.com
>>     <mailto:Glass at lists.gemtalksystems.com>
>>     http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
>     _______________________________________________
>     Glass mailing list
>     Glass at lists.gemtalksystems.com <mailto:Glass at lists.gemtalksystems.com>
>     http://lists.gemtalksystems.com/mailman/listinfo/glass
>
>
>
>
> -- 
> Mariano
> http://marianopeck.wordpress.com
>
>
> _______________________________________________
> Glass mailing list
> Glass at lists.gemtalksystems.com
> http://lists.gemtalksystems.com/mailman/listinfo/glass

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/private/glass/attachments/20150610/1abbb38a/attachment-0001.html>


More information about the Glass mailing list