HOAB

History of a bug

Introscope intrumentation static / final method

Rédigé par gorki Aucun commentaire

Problem :

It seems that I have no metric on one particular method while it works for all the others.

This is method is  :

public final boolean myMethod(myArgs) 

Does the fact that this method is final is a problem for bytecode instrumentation of Introscope ?

Solution :

No. It works :) As usual. My problem is somewhere else.

3 classes : 

Parent

package com.test.caapm.finalmethodtest;

public class ParentClass {
    public void finalMethod() {
        System.out.println("parentFinalMethod");
    }
}

Middle

package com.test.caapm.finalmethodtest;

public class TestFinalMethodAgent extends ParentClass {

    public static void staticMethod() {
        System.out.println("staticMethod");
    }

    public final static void finalStaticMethod() {
        System.out.println("finalStaticMethod");
    }

    public final void finalMethod() {
        System.out.println("finalMethod");
    }

    public static void main(String... args) {
        TestFinalMethodAgent test = new TestFinalMethodAgent();

        while(true) {
            test.finalMethod();
            TestFinalMethodAgent.staticMethod();
            TestFinalMethodAgent.finalStaticMethod();
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }

}

Child

package com.test.caapm.finalmethodtest;

public class ChildClass extends TestFinalMethodAgent{
}

Pbd

SetFlag: TestFinalMethod
TurnOn: TestFinalMethod

IdentifyDeepInheritedAs: com.test.caapm.finalmethodtest.ParentClass TestFinalMethod

TraceAllMethodsIfFlagged: TestFinalMethod PerIntervalCounter "{classname} - {method}"

 

 

 

 

 

 

OVH mutualisé et owncloud

Rédigé par gorki Aucun commentaire

Le problème :

J'essaie d'utiliser Owncloud avec un OVH mutualisé.

J'ai déplacé des fichiers dans cette arborescence, et il faut maintenant faire de la ligne de commande… qui n'est pas disponible en OVH mutualisé.

Solution :

Ligne de commande à exécuter : 

./occ files:scan <mon chemin> <mon user>

Quelques difficultés : 

  1. Accès à la ligne de commande, on utilise un shell PHP, par exemple P0wnyShell
  2. Trouver le binaire occ : il est à la racine :)
  3. Droit d'exécution sur occ : chmod 744 occ
  4. Identifier l'exécutable PHP : ps -aef | grep php
2617  9693  0 09:44 ?        00:00:00 php7.4 -c /usr/local/php7.4/etc/php-cgi.ini -d display_errors=0 -d session.force_path=1 -- p0wnyshell.php
  1. Modifier le fichier occ pour mettre le bon chemin : #!/usr/bin/env /usr/local/php7.4/bin/php
  2. Executer : 
./occ files:scan <mon chemin> <mon user>

 

Lire la suite de OVH mutualisé et owncloud

Fil RSS des articles