Planet Squeak

blogs about Squeak, Pharo, Croquet and family
planet squeak - planet squeak es - planet squeak jp - planet croquet - planet squeak code - planet smalltalk

August 15, 2019

PharoWeekly

[ANN] Pharo Pomodoro now on GitHub

I migrated my Pomodoro timer project to GitHub now:

https://github.com/astares/Pharo-Pomodoro

and you can load it using Catalog or script. I tested with Pharo 8.

See also https://twitter.com/TorstenAstares/status/1161212424982290435

Bye
T.

And yes – additionally to my blog http://astares.blogspot.com
you will also find my news on Twitter now https://twitter.com/TorstenAstares

by Stéphane Ducasse at August 15, 2019 11:19 AM

[Ann] Pharo v7.0.4

Repository: pharo-project/pharo · Tag: v7.0.4 · Commit: ccd1f64 · Released by: estebanlm

This release has 2 assets:

Visit the release page to download them.

by Stéphane Ducasse at August 15, 2019 07:42 AM

[Ann] Commander v2.0.0

Repository: pharo-spec/Commander2 · Tag: v2.0.0 · Commit: 3dbd6b1 · Released by: juliendelplanque

Commander v2.0.0 will be integrated into Pharo after ESUG.

Changelog

How to migrate code using Commander2 v1.2.0 to v2.0.0

This release provide a migration mechanism for the following renamings:

One can use the CmV2ReleaseMigrator class as follow:

1. Load the migration group

Metacello new
	repository: 'github://pharo-spec/Commander2/src';
	baseline: 'Commander2';
	load: #('migration')

2. Collect the command classes to migrate

In this step, one need to create an array of all the classes defined by his/her project that inherit from CmCommand.

An example of such script can be:

myCommandClasses := MyRootCommandClass withAllSubclasses.

3. Run the migration script

CmV2ReleaseMigrator migrate: myCommandClasses

Then run the tests of your project to ensure everything still work correctly

This release has 2 assets:

Visit the release page to download them.

 

by Stéphane Ducasse at August 15, 2019 07:29 AM

August 11, 2019

Pierce Ng

Minimizing Docker Pharo

As tweeted: Docker image of Pharo VM, 7.0.3-based app Pharo image, changes/sources files, Ubuntu 16.04, 484MB. With Pharo VM Alpine Docker image, 299MB. Build app Pharo image from minimal, run without changes/sources, Alpine Pharo VM, 83MB!

And here's the Docker container resident set size upon switching from the 484MB Docker image to the Alpine-based Docker image:

Pharo Docker RSS

Norbert Hartl and I are collaborating on minimizing Dockerized Pharo. All are welcome to join.

by Pierce Ng at August 11, 2019 11:41 PM

PharoWeekly

[ANN] Pharo Chip Designer

Hi,

I have created a little program based on an old educational game by Zachtronics (KOHCTPYKTOP: Engineer of the People[1]) named Pharo Chip Designer.
It is an inaccurate and highly simplified tool for the design of silicon chip layouts. Unlike common tools for logic circuits designs, in Pharo Chip Designer, you need to face the real-life problems like propagation delays or limited amount of layers and available substrate area.
https://github.com/pavel-krivanek/PharoChipDesigner
It contains levels from the original game, but you can play with your custom designs on larger surfaces. And of course, use all the Pharo power to control the I/O signals.
The Pharo Chip Designer required Pharo 8.0 and Spec2.
Cheers,
— Pavel
[1] http://www.zachtronics.com/kohctpyktop-engineer-of-the-people/
PharoChipDesigner.gif

by Stéphane Ducasse at August 11, 2019 08:14 AM

August 09, 2019

PharoWeekly

Autonomous robot running 100% on PharoThings IoT

Steven Costiou and @Allex Oliveira are working on an autonomous robot, all Pharo: motors, sensors and algorithms

by Stéphane Ducasse at August 09, 2019 09:26 PM

About Pharo vm activity

Hi

Some Pharo friends ask about the place Pharo consortium engineers were working on the Pharo VM: Here it is:

https://github.com/pharo-project/opensmalltalk-vm/commits/headless

https://github.com/pharo-project/opensmalltalk-vm/commits/pharo

The current focus is

You can also check the other branches about threaded and others.

A summary of my interaction with Guille, Esteban, and Pablo.

S.

by Stéphane Ducasse at August 09, 2019 08:30 AM

August 08, 2019

PharoWeekly

[ANN] Pharo Headless – Beta

For the anxious, you can get real headless vm and image from zero-conf.

$ wget get.pharo.org/64/80+vmHeadlessLatest | bash

Zero conf scripts remain unchanged for users.

However, if you are launching the VM by hand from the executable
instead of the launcher scripts (pharo and pharo-ui) as in

$ ./pharoexecutable Pharo.image

the image will launch in headless mode and will not open a window.
To launch it in headfull, you can use the –interactive argument after
the image, which will make the image open a window using SDL2.

$ ./pharoexecutable Pharo.image –interactive

Long version
============

Hi, this mail is the happy intermediate result of the work that us,
the Pharo Consortium Team, has been doing in the last couple of
months.
Our main objective is to have a real headless implementation of Pharo
where all the responsibility to open or not a World window (or other)
is handled by the image.
For doing so we have done a series of modifications in the image and
the VM side.
We consider this is the path that Pharo 8 and following versions
should follow, as it will severely improve server-side and command
line Pharo and in building custom desktop applications.

These modifications are available only in 64-bits machines (Windows,
OSX, and Linux).
ARM32 and 64bits headless is in the roadmap, but it is delayed because
we have prioritized our three major platforms for this first couple of
months.

All this work is based in Opensmalltalk-VM and Ronnie’s initial work
on headless.
We are really grateful to all the contributors in the history of this
nice product.
To achieve a real headless VM we have brought modifications in the
source tree because most of the platform code to open and manipulate
windows is not required anymore.
Instead, we use the SDL2 library that implements a nice layer on top
of the OS and allows us to manage on the image side through FFI.

So this mail is now an open call for (beta?)testing.
The sources of the current VM we are building are in the headless branch in
https://github.com/pharo-project/opensmalltalk-vm
And we have set up a CI that is both building and testing the VM in
https://ci.inria.fr/pharo-ci-jenkins2/job/pharo-vm/job/headless/

For the future we have a lot of ideas, that will wait for another long
email or a beer-talk @ESUG.
We want to hear your ideas!!

Image-Side Improvements
=======================

– The image handles the creation or not of the main world window.
– We incorporated the idea of World renderer, where different backends
are used to render the world.
– We have 3 backends: VM support (compatibility with non-headless
VMs), and OSWindow with two backends: SDL and GTK3+.
– The modifications in the image are fully backward compatible with
the non-headless VM and are pushed since weeks in the latest 8.0
image.
– We move the handling of events to the image side when using SDL and
GTK3+, opening the door to a richer set of events and finer-grained
control over them.
– SDL and GTK versions are implemented using FFI calls.

VM-Side Improvements
====================

– VMMaker code migrated to Tonel thanks to Feenk and included in the
repository of the VM.
– Making VMMaker execute in Pharo 7 and 8.
– Removing GPL code from the VM repository (GDB).

– Slowly adding new tests for the JIT / Slang and VMGeneration.
– Restructuring of the source code.
– A new simpler CMake build.
– Generate VM code from Slang on each build.
– A CI process to validate (including the run of the tests in Pharo
and the ones adding to the VM).
– Simplification of the codebase.

– Maximize the reuse of code between the platforms (preferring the
standard versions over the platform-specific).
– Cleaning up duplicated code.
– All the plugins are now external plugins.
– The VM is now a dynamic library. This is a first step towards
embedding Pharo into other applications.
– The main executable is a thin frontend (you can change it or
implement your own).

– Removing unused plugins.
– Improved crash dump. Especially the crash dump works now in Windows 64bits.
– Dummy implementation of Security plugin (it is going away…. eventually).
– Cleanup of SSL, UUID, and Socket plugin.

– Cleanup of conditional code (Still to improve).
– Improving the types used in the functions (we have to be neat to be
multiplatform/multi-arch).
– Improving the lookup of modules
– Improving the logging of the VM
– Improving the handling of VM arguments

Thanks a lot for reading so long!!
We hope you enjoy the VM and please tell us all the problems you find!!

Pablo, Guille, and Esteban

by Stéphane Ducasse at August 08, 2019 05:21 PM

August 03, 2019

PharoWeekly

[Ann] Machine code simulation in Pharo

Hi everybody,
I’ve been playing around with machine code simulation this last week and I’ve made bindings for the unicorn library and the llvm disassembler:
https://github.com/guillep/pharo-unicorn
https://github.com/guillep/pharo-llvmDisassembler
Funny thing: both support lots of platforms (x86 and arm both 32 and 64 bits and more…). So out of the box we can simulate and disassemble lots of platforms.
And in one afternoon I’ve played with them to do a native debugger with Spec2 just for fun.
Hope this evolves a bit more soon, and that it helps somebody.
PastedGraphic-5.png
Guille

by Stéphane Ducasse at August 03, 2019 10:16 AM

July 26, 2019

PharoWeekly

[ann] Smalltalk WebCamp day in Ghent

Hi Seaside users,

We are organising a Smalltalk WebCamp day in the Yesplan offices in Ghent on October 22nd.
The idea originated in the Seaside channel of the Pharo discord group. However, it’s not supposed to be Seaside only. All Smalltalkers doing web development, possibly involving other technologies on top of Smalltalk, are encouraged to join. Let’s meet and exchange ideas. The topics are to be determined, following the idea of an unconference [1], except that, for practical reasons, we will ask you to confirm your attendance beforehand.
More info to follow asap.
Save the date and respond already to the group if you are interested to attend.
Cheers
Johan
[1] https://en.wikipedia.org/wiki/Unconference

by Stéphane Ducasse at July 26, 2019 06:26 AM

July 23, 2019

PharoWeekly

Tech Talk Video: How to contribute to Pharo

by Stéphane Ducasse at July 23, 2019 01:44 PM

July 22, 2019

PharoWeekly

[ANN] GistBrowser-Pharo.

Interact with GitHub Gist on Pharo.
https://brackendev.github.io/GistBrowser-Pharo/

brackendev.github.io

by Stéphane Ducasse at July 22, 2019 08:37 AM

July 21, 2019

PharoWeekly

Weekly digest… a way to understand activity around Pharo

What is nice with weekly digest is that you get a feel for the activity in Pharo (at least in its master branch) and on its core. Other activities often happen in separate projects (Spec2, Iceberg, …) and each of their commit contains a large set of improvements. Still these weekly digest are nice (especially since I was doing them manually in the past).

https://github.com/pharo-project/pharo/issues/3814

S.

by Stéphane Ducasse at July 21, 2019 03:00 PM

Moldable IDE/Feenk with Pharo at CurryOn

Really nice talk with Pharo inside or outside 🙂

https://www.youtube.com/watch?v=Pot9GnHFOVU

Well done doru!

S.

by Stéphane Ducasse at July 21, 2019 07:20 AM

July 20, 2019

Pierce Ng

PoC: Alpine Linux Minimal Stateless Pharo

Alpine Linux is a security-oriented, lightweight distro based on musl-libc and BusyBox. Official Docker images of Alpine Linux are about 5MB each.

I've successfully built the pharo.cog.spur.minheadless OpenSmalltalk VM on Alpine Linux. Dockerizing the Pharo VM files plus a built-from-source libsqlite3.so (without Pharo image/changes/etc) produces a Docker image weighing in at 12.5MB.

% sudo docker images | egrep "samadhiweb.*alpine"
samadhiweb/pharo7vm                    alpine              299420ff0e03        21 minutes ago      12.5MB

Pharo provides minimal images that contain basic Pharo packages without the integrated GUI, useful for building server-side applications.

From the Pharo 7.0.3 minimal image, I've built a "stateless" image containing FFI, Fuel, and UDBC-SQLite. "Stateless" means the image can be executed by the Pharo VM without the changes and sources files. Here are the sizes of the base minimal image and my SQLite image:

% ls -l udbcsqlite.image Pharo7.0.3-0-metacello-64bit-0903ade.image 
-rw-rw-r-- 1 pierce pierce 13863032 Apr 12 22:56 Pharo7.0.3-0-metacello-64bit-0903ade.image
-rw-rw-r-- 3 pierce pierce 17140552 Jul 20 14:11 udbcsqlite.image

Below, I run the image statelessly on my Ubuntu laptop. Note that this uses the regular Pharo VM, not the Alpine Linux one.

% mkdir stateless
% cd stateless
% ln ../udbcsqlite.image
% chmod 444 udbcsqlite.image
% cat > runtests.sh <<EOF
#!/bin/sh
~/pkg/pharo7vm/gofaro -vm-display-none udbcsqlite.image test --junit-xml-output "UDBC-Tests-SQLite-Base"
EOF
% chmod a+x runtests.sh
% ls -l
total 16744
-rwxr-xr-x 1 pierce pierce      116 Jul 20 15:25 runtests.sh*
-r--r--r-- 3 pierce pierce 17140552 Jul 20 14:11 udbcsqlite.image
% 
%
% ./runtests.sh
Running tests in 1 Packages
71 run, 71 passes, 0 failures, 0 errors.
% ls -l 
total 16764
-rw-r--r-- 1 pierce pierce     6360 Jul 20 15:26 progress.log
-rwxr-xr-x 1 pierce pierce      116 Jul 20 15:25 runtests.sh*
-r--r--r-- 3 pierce pierce 17140552 Jul 20 14:11 udbcsqlite.image
-rw-r--r-- 1 pierce pierce    11072 Jul 20 15:26 UDBC-Tests-SQLite-Base-Test.xml

Dockerizing udbcsqlite.image together with the aforementioned Alpine Linux Pharo VM produces a Docker image that is 46.8 MB in size.

% sudo docker images | egrep "samadhiweb.*alpine"
samadhiweb/p7minsqlite                 alpine              3a57853099d0        44 minutes ago      46.8MB
samadhiweb/pharo7vm                    alpine              299420ff0e03        About an hour ago   12.5MB

Run the Docker image:

% sudo docker run --ulimit rtprio=2 samadhiweb/p7minsqlite:alpine
Running tests in 1 Packages
71 run, 71 passes, 0 failures, 0 errors.

For comparison and contrast, here are the sizes of the regular Pharo 7.0.3 image, changes and sources files:

% ls -l Pharo7.0*-0903ade.* 
-rw-rw-r-- 1 pierce pierce      190 Apr 12 22:57 Pharo7.0.3-0-64bit-0903ade.changes
-rw-rw-r-- 1 pierce pierce 52455648 Apr 12 22:57 Pharo7.0.3-0-64bit-0903ade.image
-rw-rw-r-- 2 pierce pierce 34333231 Apr 12 22:55 Pharo7.0-32bit-0903ade.sources

by Pierce Ng at July 20, 2019 03:51 PM

July 18, 2019

PharoWeekly

[ann] GitBridge

Hi!

Today I released the v1 of a project I wanted to do since a long time:
GitBridge.

The goal of the project is to easily access external resources stored in
the git repository of the project and other information.

For more infos check the Quick start or documentation present at:
https://github.com/jecisc/GitBridge

When Monticello was the most common VCS usable with Pharo we stored a
lot of external resources in the image. Now we are able to store them
outside, get a lighter image and make it easier to edit and version them!

This can be useful to store test resources, CSS/JS files for web
applications, documentation, etc.

This can also be useful to get from the application some information
such as the current version of the application instead of hard-coding it
in a method to update at each release.

It implementation relies on Iceberg and the repositories registered in it.


Cyril Ferlicot
https://ferlicot.fr

by Stéphane Ducasse at July 18, 2019 03:57 PM

July 17, 2019

PharoWeekly

[ann] Moose v7.0.0

Hello everyone!

I’m glad to announce the release of Moose v7.0.0.

I’ll explain the main changes since Moose 6.1 and what are the future
plans for Moose 8 in this mail.

* What changed?

In this version of Moose a lot of things changed from the meta model
management point of view. In Moose 6.1 we only had one big metamodel
build with inheritance to analyze all languages. This had a lot of
limits and a lot of work has been done to improve Moose on those weak
points.

In Moose 7, you can now have multiple meta-models independant from
each others. This mean that we will now have one meta model by parser.
We can also create simple meta-models for test purpose. Also those MM
are build by composing stateful traits instead of using inheritance.

On top of that we now also have the possibility to use generators to
manage meta-models. Instead of writing every classes by hand, we can
describe a meta-model in a generator and use it to generate the MM.
Then we can use it to regenerate it also.

Pavel, who did most of the work, wrote some documentation you can find
here: https://pavel-krivanek.github.io/famix/

There is still a lot of work to do to make it better but this will
come with Moose 8. The reason we release now is that in Moose 7 we
started to have split MM for Java, Pharo, and other languages, but we
still have a compatibility meta-model. The work needed to improve
Moose further will require to break the compatibility MM. Thus we are
releasing a stable version now with a compatibility MM and we will
work on a Moose 8 version where the compatibility MM will be removed.

* Workflow for bugfixes

Another change with Moose 6.1 is that now Moose is managed via Github.
This will allow use to do patches or minor releases in case the
community find bugs or need some new simple features in Moose 7 as
long as it only contains backward compatible changes.

* Plan for the next release

We already stated to work on Moose 8. We plan to work on multiple aspects:
– Improve the usability of the generator, especialy while regenerating MMs
– Update the Traits contained in Moose to build our MM. Currently,
they are a reproduction of what was in Moose 6.1 in order to get the
compatibility model. The goal is to remove all the hacks and get
cleaner traits.
– Start to build new tools to use the full power of this new version of Moose
– Fix bugs that will be discovered after such a big change

* How to get Moose 7

You can get Moose 7 in two ways. First is to install it in a Pharo 7 image:

“`
Metacello new
baseline: ‘Moose’;
repository: ‘github://moosetechnology/Moose:v7.x.x/src‘;
load.
“`

The second is to get it via the Pharo Launcher. It now has a Moose 7
entry to get this version and a Moose 8 entry to get the development
version.

We will also need to update Moose technology website.

* Credits

Thank to Pavel Krivanek who did most of the work.

Thank also to:
– Benoit Verhaeghe
– Julien Delplanque
– George Ganea
– Christopher Fuhrman
– Stephane Ducasse
– Anne Etien
– Nicolas Anquetil
– Cyril Ferlicot

And any other I might have forgot who participated in the development
of Moose 7 🙂


Cyril Ferlicot
https://ferlicot.fr

by Stéphane Ducasse at July 17, 2019 03:46 PM

July 14, 2019

Pierce Ng

Gitea

Gitea is an open source Github-lookalike written in Go. Building Gitea from source is straightforward; the output is a single executable gitea. Pre-built binaries and Docker images are also available.

Once configured appropriately, gitea runs a HTTP server, which provides the Github-ish user interface, and a built-in SSH server, which is used for synchronizing Git repos.

In Pharo, Iceberg works with a locally running Gitea just like it works with Github.

I've been using Monticello for version control of my little tools. Monticello works when requirements are simple. But some of the tools have grown enough to need a VCS with good branching and merging capabilities.

by Pierce Ng at July 14, 2019 09:05 PM

July 11, 2019

PharoWeekly

[ann] MessageFlowBrowser

Hi,

I updated my MessageFlowBrowser today to work on Pharo 7 and 8, see attached screenshot
or youtube video on https://www.youtube.com/watch?v=DRd_bzGocQg

It now also works in Calypso and you just need to right click on a method in the method
pane or code pane and select “Message Flow” close to Senders, Implementors and other.

You can load the tool using

Metacello new
repository: ‘github://astares/Pharo-MessageFlowBrowser/src‘;
baseline: ‘MessageFlowBrowser’;
load

I also now moved repo from

http://www.smalltalkhub.com/#!/~TorstenBergmann/MessageFlowBrowser

to the new location

https://github.com/astares/Pharo-MessageFlowBrowser

on GitHub for future development.

Have fun,
T.

by Stéphane Ducasse at July 11, 2019 04:48 PM

July 10, 2019

PharoWeekly

[ANN] Pharo Launcher 1.9.1 released

Hi all,

We are pleased to announce Pharo Launcher 1.9.1 release!
The goal of this release is to have a better Windows support. Indeed Pharo Launcher now uses a new library OSWinSubprocess (https://github.com/pharo-contributions/OSWinSubprocess) created for Pharo Launcher needs. This library allows to create Windows processes through ffi calls to the Windows API. It uses the unicode api, allowing paths with non-ascii characters.
In the same time, we switched from OSProcess to  OSSubprocess (Linux and OS X) that is now the preferred library to use to fork processes on Linux-based systems.
This release is not yet the default download of Pharo Launcher on Pharo web site because we want more feedback before promoting it.
Please use this link to install it: https://files.pharo.org/pharo-launcher/1.9.1 and let us know if this version works fine/better for you.
ps: For now, the binary is not signed but it will come soon.
ps2: Thanks to Keldon Alleyne for his PR on Pharo Launcher offering the first FFI binding to Windows process API
Regards,
The Pharo team.

by Stéphane Ducasse at July 10, 2019 09:55 AM

[ANN] OSWinSubprocess a library to spawn Windows System processes

Hi,
Pharo Launcher had stability problems to spawn new processes (launch Pharo images) on Windows as well as limitations (paths could only contain ASCII characters).
To solve this problem, we developed a new library: OSWinSubprocess (https://github.com/pharo-contributions/OSWinSubprocess) and decided to make it a standalone library so that people can use it if they need to.
We tried to use the same API as OSSubprocess when possible. This library uses the Windows API to create process from both 32-bit and 64-bit Pharo images. It also supports Unicode characters.
Here are some examples on how to use it:
process := OSWSWinProcess new 
		command: 'C:\Windows\notepad.exe';
		run.
...
process terminate.
OSWSWinProcess new 
		command: 'C:\Windows\notepad.exe';
		arguments: #('notepad.exe' 'C:\foo.txt');
		runAndWait.
Important note: As of now, this library does not yet support standard streams (stdin, stdout and stderr). It could be done by setting the appropriate information in the STARTUPINFO structutre.
You can check the README for more information.
Regards,
Christophe.

by Stéphane Ducasse at July 10, 2019 04:45 AM

July 09, 2019

PharoWeekly

Call for improving Pharo together

Hey YOU, YES YOU !

it was in 2017 when I asked people here on this list to help cleaning and raise the quality level of our Pharo system:
http://forum.world.st/Pharo-Quality-raising-the-quality-level-in-Pharo-7-and-onwards-tp5027111.html

I not only talked. I took action – meanwhile with around 658 (!) sometimes very trivial changes to
get Pharo 7 and 8 into a cleaner state (https://github.com/astares/pharo/branches)

One step at a time … evening per evening, week per week. Sometimes there was a minute – sometimes not.

And yes: Pharo already became cleaner with small contributions from my and many others contributors side. Pharo now
already feels a little bit better – has class and test comments, more aligned packages, fixed categories,
less typos, cleaner and more understandable code and more rules to hopefully keep that quality level.

What if YOU, YES YOU would also step in and also apply simple or complex fixes and cleanups on internal
and also external packages? You could also help with documentation or feedback on what is working and what not.

If we all clean the house TOGETHER the next guest would feel already more comfortable and also try not to
wear his dirty shoes…

I also intentionally opened one single trivial issue without fixing it myself. Now today this issue got somehow
“famous” on Twitter:  https://twitter.com/marcusdenker/status/1148287564937400321

and YOU can get famous for FIXING or REVIEWING this single issue too.

Or you can help with many others that are left either here: https://github.com/orgs/pharo-project/projects/8
or here: https://github.com/pharo-project/pharo/issues

Jump in – the water is just fine!

Bye
Torsten (aka “astares” on Discord)

by Stéphane Ducasse at July 09, 2019 04:43 AM

July 04, 2019

Torsten Bergmann

PolySLAM and Pharo

PolySLAM (Polygon based Simultaneous Localization And Mapping) is a solution for multi-robot exploration of indoor environments.

Pharo Smalltalk was used to implement and simulate it.

Read more here or watch the video:

by Torsten (noreply@blogger.com) at July 04, 2019 04:02 PM

Smalltalk and the largest MIDI instrument

Mariano has a nice story on using Smalltalk to control the largest MIDI instrument of the world. Nice and well done.

Smalltalk always rocks!

by Torsten (noreply@blogger.com) at July 04, 2019 03:49 PM

Pharo Compiler: add the concept of a Production Environment

In Pharo so far the Compiler compiled into instances of class CompiledMethod. Now, there might be the case that the result of the compiler (the compiledMethod) should not be an instance of the class CompiledMethod from the environment in which we compile, but from some other environment.

The Pharo compiler is now able to support that as Marcus explains here.

This is more flexible and should allow for cross compiling locally or into remote environments. One could use it to build up a new environment within the existing one, ...

Nice!

by Torsten (noreply@blogger.com) at July 04, 2019 07:25 AM

July 03, 2019

Pierce Ng

Telemon: Pharo metrics for Telegraf

In my previous post on the TIG monitoring stack, I mentioned that Telegraf supports a large number of input plugins. One of these is the generic HTTP plugin that collects from one or more HTTP(S) endpoints producing metrics in supported input data formats.

I've implemented Telemon, a Pharo package that allows producing Pharo VM and application-specific metrics compatible with the Telegraf HTTP input plugin.

Telemon works as a Zinc ZnServer delegate. It produces metrics in the InfluxDB line protocol format. By default, Telemon produces the metrics generated by VirtualMachine>>statisticsReport and its output looks like this:

TmMetricsDelegate new renderInfluxDB
"pharo uptime=1452854,oldSpace=155813664,youngSpace=2395408,memory=164765696,memoryFree=160273136,fullGCs=3,fullGCTime=477,incrGCs=9585,incrGCTime=9656,tenureCount=610024"

As per the InfluxDB line protocol, 'pharo' is the name of the measurement, and the items in key-value format form the field set.

To add a tag to the measurement:

| tm |
tm := TmMetricsDelegate new. 
tm tags at: 'host' put: 'telemon-1'.
tm renderInfluxDB
"pharo,host=telemon-1 uptime=2023314,oldSpace=139036448,youngSpace=5649200,memory=147988480,memoryFree=140242128,fullGCs=4,fullGCTime=660,incrGCs=14291,incrGCTime=12899,tenureCount=696589"

Above, the tag set consists of "host=telemon-1".

Here's another invocation that adds two user-specified metrics but no tag.

| tm |
tm := TmMetricsDelegate new. 
tm fields 
  at: 'meaning' put: [ 42 ];
  at: 'newMeaning' put: [ 84 ].
tm  renderInfluxDB
"pharo uptime=2548014,oldSpace=139036448,youngSpace=3651736,memory=147988480,memoryFree=142239592,fullGCs=4,fullGCTime=660,incrGCs=18503,incrGCTime=16632,tenureCount=747211,meaning=42,newMeaning=84"

Note that the field values are Smalltalk blocks that will be evaluated dynamically.


When I was reading the specifications for Telegraf's plugins, the InfluxDB line protocol, etc., it all felt rather dry. I imagine this short post is the same so far for the reader who isn't familiar with how the TIG components work together. So here are teaser screenshots of the Grafana panels for the Pharo VM and blog-specific metrics for this blog, which I will write about in the next post.

This Grafana panel shows a blog-specific metric named 'zEntity Count'.

Grafana Pharo app metrics

This next panel shows the blog-specific metric 'zEntity Memory' together with the VM metric 'Used Memory' which is the difference between the 'memory' and 'memoryFree' fields.

Grafana Pharo VM and app metrics

This blog runs in a Docker container. The final panel below shows the resident set size (RSS) of the container as reported by the Docker engine.

Grafana Pharo Docker metrics

by Pierce Ng at July 03, 2019 08:27 PM

Torsten Bergmann

Telemon: Pharo and TIG

Pierce has two interesting blogposts:

He implemented Telemon - a Pharo package that allows producing Pharo VM and application-specific metrics compatible with the Telegraf HTTP input plugin

by Torsten (noreply@blogger.com) at July 03, 2019 04:08 PM

PlantUML from Moose Java model in Pharo 8

Beginning of June I reported on "PlantUML access from Pharo". Now there is another video available:

by Torsten (noreply@blogger.com) at July 03, 2019 04:03 PM

PharoWeekly

Compiler enhancements

Hi,

We added support for setting a “production environment” for the compiler:

When compiling, there might be the case that the result of the compiler (the compiledMethod) should not be an instance of the class CompiledMethod from the environment
in which we compile, but from some other environment.

(e.g. imagine you have multiple environments and want to cross cross compile)

This PR adds the concept of a productionEnvironment and enables it for CompiledMethod.
(other use cases might make sense, too, for example all the literals in the CompiledMethod, this is future work but can be done similarly by handing the context into the Scanner)

This is our test for CompiledMethod:

testCompileWithProductionEnvironment
| environment method return |
environment := {#CompiledMethod -> MyCompiledMethodForTesting} asDictionary.
method := Smalltalk compiler
productionEnvironment: environment;
compile: ‘tt ^1+2’.

self assert: method class equals: MyCompiledMethodForTesting.
return := method valueWithReceiver: nil arguments: #().
self assert: return equals: 3.

As one can see, the produces compiled method of the Compiler is an instance of our class.

PR needs a Review: https://github.com/pharo-project/pharo/pull/3749/files

by Stéphane Ducasse at July 03, 2019 12:28 PM

June 30, 2019

Torsten Bergmann

Revealing ALLSTOCKER

Allstocker (https://allstocker.com) is one of the success stories of Pharo. There is a presentation prepared for "Smalltalk Day Japan 2019" revealing some infos on how Pharo and other technologies are used.

by Torsten (noreply@blogger.com) at June 30, 2019 09:40 AM