3

We have a requirement of getting the size of package that is published and record the same in an excel or text file. Then process that data and give the average size by monitoring for sometime . Cleanup attribute is set to true to keep the server clean.

One more add on, we should also be able to check a flag on CM such as a field value in a component whether it is turned on or off.Depending on its value the above should work.

Please provide some pointers on how to achieve this without much impact on overall performance. Any best practices would also help.

3
  • Is CD on a Unix based OS or Windows? My initial thought is to capture the size of the package zip somehow (Deployer extension or a native OS event of somesort). Also, have you thought through any options yourself, and if so, where did you get stuck? Jan 31, 2014 at 8:47
  • It is a windows based server. I am just thinking of using a deployer extension. Need to start a POC.
    – Guest19876
    Jan 31, 2014 at 9:52
  • 2
    Maybe just using Windows Auditing Policies on the "Incoming" folder may be an option.
    – Puntero
    Jan 31, 2014 at 10:25

5 Answers 5

2

A more straightforward way to approach this would be to capture the package name and size (and any other relevant attributes) on the Content Manager / Publisher server. As I am sure you are aware, after rendering, a Transport Package is created and temporarily written to the File System in the WorkFolder prior to transport.

It would be very easy, using the .NET FileSystemWatcher (FileSystemWatcher Class), to create a simple Command Line application or Windows Service to monitor the WorkFolder for new transport packages and record their details to a text or Excel file. (Note that you will have to watch for both Created and Changed events (see here for a quick reference) as the file may not be completely written when OnCreated is fired.) Such an application would have minimal overhead and should not interfere with the performance of the Content Manager / Publisher, and would be able to capture details of the transport packages before clean-up occurs.

Addressing the second part (switching on and off) a couple of thoughts come to mind:

  1. If it is set up as a Windows service, with the appropriate permissions, it can be controlled (Start, Stop, Pause, Restart) normally using standard Windows / server management tools.
  2. The application or service could expose a WCF endpoint that would accept authenticated commands from a Custom Page or GUI button in the Content Manager Explorer.
  3. Although rather unorthodox, it is possible to read the contents of Transport Packages (which are essentially ZIP files). Your application could look for a "special" Page or Component Presentation (or flag therein) and respond accordingly. Just make sure that your file reader is non-locking to avoid issues with the Transport Service trying to read the file for transport.
4

You don't mention what Transport Protocol you are using, but if you are using FTP(s) or HTTP(s) to get the packages to your Deployer, you can probably just enable logging on your web/ftp server, and it will record the size of the POST requests or Uploads.

Unfortunately this won't work if you are using Local File System.

Keep in mind that if you use a Deployer Extension, you won't be able to log transport packages which fail in the Transporting phase.

1

Another good way to accomplish it is to use a Transport Handler, it will cover all the scenarios since it will be executed regardless of the Schema Protocol (FTP, HTTP, File System) and it will be executed during Transporting when the Transport Package has been created. Basically you can get access to the Package as an object and get the Storage Location (Zip file location) then you can write logic to get the size and log it.

There are some details in this Adding Custom Instructions during Unpublish

Note: This is a not documented extension point and not supported.

0

You can achieve this through Deployer Extension.

In the SDLTridionWorld, @Jaime has explained in detailed about deployer extension in his tutorial.

Deployer Extensions with Eclipse

Hope this would help you.

0

We have done the implementation by extending the transport layer HTTPSTransportConnector and overriding the send method which has File as parameter. You can use file.length to get the size of the file in byte.

1
  • 1
    This answer has been flagged as low-quality. I think Stack Exchange does this automatically if someone puts a very short answer. Perhaps you could give some more information about your implementation. I think that would be helpful, because other than extending one of the Tridion classes, I really don't get much of a picture of what you've done. Feb 9, 2014 at 19:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.